I’m looking for a post effect shader to apply to the camera that makes the screen unlit, not factoring in lights, just rendering the albedo. Is there some already floating around that I don’t need to reinvent the wheel? I mainly asking because I have little understanding of shader code, and I’m not sure how to make this possible. In this example, the right side is unlit. The left side is lot.
I’ve poking around in some shader code a bit too, but I’m not sure I understand shaders enough to know what I’m doing. Would not mind having some help understanding. Thank you.
Edit: I know I could use SetReplacementShader(); And replace the camera shader with the unlit shader and this works fine, but it also disallows me to apply other shaders to it such as AO, AA, etc. Without putting all this into one shader, the Unlit surface shader will not give the same affect if I apply it to a material and use that on the camera.
Yep, just sample the diffuse G-Buffer in deferred and render that. Easy.
My free Night Vision asset samples the diffuse G-Buffer, just remove all the code after that that actually applies the night vision effect - Unity Asset Store - The Best Assets for Game Making - effectively you’ll just be doing something like:
float4 col = tex2D(_DiffuseGBuffer, uv); (Forget which GBuffer texture # diffuse is, probably 1)
return col;
Hah, that simple eh? Man, I really don’t know my shader code. Well, this should helps me a bit. Much appreciated. I’ll poke around the shader code and see if I can figure out how to use it because just having that code gives a solid gray screen. Thanks again.
According to documentation CameraGBufferTexture0 is the diffuse.
Edit: Solved
Also, this messed me up for a long time. It is fixed now. If you are using these buffers on the camera, make sure the camera’s rendering mode is set to “deferred” or it will not work. I had thought it was, but despite my thought, it actually wasn’t so I was wrecking my brain trying to figure out what was wrong and it turned out it was my own foolish mistake on a overlooked setting. Thanks GoGoGadget