|
I'm currently running a edited version of the DepthNormal encoding PostProcessing shader, and when trying to use it with a terrain using lightmapped based lighting, it creates this log message every frame:
I've also tried setting up the shader with the default builtin shader provided on the Unity site (the one I originally edited from) and it also produces this error, however when setting up the camera with the new "Camera.depthTextureMode" settings, which uses this shader internally, it doesn't cause this error. Can anyone shed some light on why this might be happening, or any way of getting around this error, as we need to use an edited version of the DepthNormals encoding Post Processing shader.
(comments are locked)
|
|
Like Jonas said, lightmapped terrain does not build normals in the mesh for efficiency reasons (it does not need them at runtime). The only exception is, when Camera.depthTextureMode is Depth+Normals, in that case it builds the normals because they are needed. Currently there's no way to manually force terrain to always provide normals. Can you explain your use case? (e.g. maybe Camera.depthTextureMode would just work for you?) We are using a shader which is basically transparent cutout with culling turned off, and two Post Processing shaders that use the normal/depth buffer. In order for the objects that use that shader to render into the depth buffer properly, we need to use an edited version of the Camera - DepthNormalTexture texture to accommodate the lack of culling. Thanks for confirming my suspicions on this problem. Would it be possible to put a manual check for this in future versions of Unity? Should I put a request for it on the Feedback site?
Dec 01 '09 at 11:15 PM
Murcho
Yeah, a request on http://feedback.unity3d.com seems appropriate.
Dec 02 '09 at 08:12 AM
Aras ♦♦
(comments are locked)
|
|
As the terrain gets it's lighting information from the lightmap, it does not need any normals, so the engine skips calculating those in lightmapped mode. Can you switch to vertex or realtime lighting modes? We can, however the performance boost from having a lightmapped terrain would be nice. Currently the scene we're running tops out at around 3000 draw calls and we're looking for any way to try and optimize. My main question was the fact that it doesn't cause these errors to be called when using the Camera.depthTextureMode with the shader, so is there some way of adding that functionality to the manual replacement shader calls?
Dec 01 '09 at 10:49 AM
Murcho
(comments are locked)
|
