Hey guys, I want to get the direction map(directional specular bake) in a vert frag shader.Get the light map is easy just sample “unity_Lightmap”.How to get another one?![]()
Another question is, used standard shader baked have normal map’s information,how to let unity get the normal map in vert frag shader?
umm…somebody said
UNITY_SAMPLE_TEX2D_SAMPLER(unity_LightmapInd,unity_Lightmap,1)
can get this map, but my shader will post an error:
Fragment program ‘frag’: sampler ‘samplerunity_Lightmap’ has no matching texture and will be undefined.
I also want the “realtime directional map” as specified here : https://forum.unity3d.com/threads/directional-lightmaps.280716/
For the normal and depth information you can use the _CameraDepthNormalsTexture in the shader. You can decode it using :
DecodeDepthNormal(tex2D(_CameraDepthNormalsTexture,i.uv),decodedDepth,decodedNormal);
did anyone ever figure this out?