#RenderTexture material not working

1 messages · Page 1 of 1 (latest)

junior heath
#

Followed a tut on how to render a camera to a material to showcase on an in-game object like a screen, and the assets folder shows the material correctly displaying it, even before I start the scene (the colors are purple when not running it and the material shows as purple as well), but then in-game screen is just a white square. It doesnt show the material properly. When I change the material's surface inputs to have the rendertexture be on the occlusion map (instead of the base map) , the rings show, but then the color is missing (img2). Not sure what the issue is

#

and yes, the camera output texture is set to the rendertexture, which is why its showing up on the material as well, just not in scene which is odd

vague crescent
junior heath
#

are u referring to the pink color ? Cuz when I said purple I meant that the grid itself is purple off its default color, its supposed to be purple; nothing wrong there. It changes to blue/red once I run the scene though.

2DGridView is the render texture, im using a custom shader script for the material/shader for the rings/contours, which might explain it, unless ur talking about the 2DMap material itself, which was just a normal render texture. Do i have to specify some things in the custom ring shader for the camera to allow it to be able to show it ?

vague crescent
vague crescent
junior heath
vague crescent
#

Wich one has the issue?

#

Can you maybe record a video showing the setup and the issue?

junior heath
#

set up is:

The big white square I scaled up at the beginning is the screen, which has the material attached to it, the material containing the render texture of the 2nd camera I got set up showing a top down view of the grid

#

and basically changing from base map to occlusion map shows SOMETHING, so somethings working lol

vague crescent
junior heath
#

yes, it should basically be showing up exactly what the camera would be seeing

#

the confusing part to me is the fact that the material does change colors correctly in the assets folder

vague crescent
#

Then why are you assigning it to occlusion map instead of base color?

vague crescent
junior heath
#

it was in the initial post

vague crescent
#

That's when you assign it to base color?

junior heath
#

right, I did. Thats where my question is coming from though. When base map didnt work, since when it IS base map ( i showed changing it in the video to occlusion map), the square remains completely white, its just a 2d sprite square

vague crescent
#

I'm still struggling to understand the issue. It seems to be working when you assign the RT to base color, so what is the problem then?

vague crescent
junior heath
#

and no, its not working when its in base map

#

which is the issue

vague crescent
#

This here looks like a completely white texture is assigned

#

Not your RT

#

When you select the object in the scene that has the material.

junior heath
#

thats true. I guess thats the main issue im facing and im not understanding.

Img1 is purely the material asset, in it is the render texture circled

img2 is the 2dsprite square, thats supposed to be the screen. It has the material with the render texture on it, but like u mentioned, the base map on the instance of the material on the square object is white, and idk why

#

im literally just attaching the material to the square GO and for some reason the base map turns white on that GO's material instance

vague crescent
junior heath
#

well the material to the GO

#

but yes, I put the RT on the base map of the material while the scene was NOT running

vague crescent
# junior heath i have been. redid it again here too

Ah, I see. This is likely a behavior specific to sprite renderer. As it tries to override the material properties with a sprite assigned to the renderer(or a default one).
Try using a quad mesh with a mesh renderer instead.