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
#RenderTexture material not working
1 messages · Page 1 of 1 (latest)
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
purple means missing/incompatible shader. You likely don't have a valid shader/material assigned by default.
As for the discoloration, is the "2dGridView" your render texture? If it is, then there's likely an issue with your material/shader.
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 ?
Ah, okay. I thought the whole object is rendered in pink/purple/cyan.
As for the shader, I'm referring to the one used in the scene.
which one? The custom render texture on the plane im trying to show on the "screen shader", or the screen shader itself
Wich one has the issue?
Can you maybe record a video showing the setup and the issue?
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
To be clear, you expect it to preserve the color right?
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
Then why are you assigning it to occlusion map instead of base color?
Where? I don't see that in the video.
it was in the initial post
That's when you assign it to base color?
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
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?
It seemed like a different texture is assigned
thats exactly what im asking lol
and no, its not working when its in base map
which is the issue
wdym
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.
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
Can you try attaching the RT to the material in the scene before play time?
i have been. redid it again here too
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
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.