Unity, graphics.blit (NULL, NULL, mat,0);

Source: Internet
Author: User

I use

Graphics.blit (NULL, FINALRT, MAT);

Synthesize a FINALRT and use FINALRT in the oninspector of the editor script

Graphics.drawtexture (RECT,FINALRT,MAT2);

To draw, the results show that the M_FINALRT display is wrong, and that the physical texture of FINALRT as a texture in the game scene is also wrong.

But if I block Graphics.drawtexture (RECT,FINALRT,MAT2), the objects in the game scene with FINALRT as textures will not get wrong, but of course I don't see FINALRT previews in inspector.

The experiment found that if the graphics.blit (null, FINALRT, MAT) followed by an additional sentence:

#if Unity_editor
Graphics.blit (null, NULL, mat,0);//if I want to draw finalrt with a shader in editor script, I must write this line, why?
# endif

Then the result is normal.

I don't know why.

Unity, graphics.blit (NULL, NULL, mat,0);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.