|
I have an issue where my terrain is being culled inappropriately when used with a buffer I am constructing with the RenderWithShader functionality. The camera is created and then disabled immediately. Each frame I call this in OnPreCull:
So the camera has the same farClip as my main camera (I've debugged to confirm this). Here's a shot of the main camera's view:
And then here is a shot of the RenderWith Shader (Terrain should render completely green):
Any Thoughts? Why is the culling happening inappropriately?
(comments are locked)
|
|
your snippet is being called on the OnPreCull? the RenderWithShader function doesn't calls OnPreCull http://unity3d.com/support/documentation/ScriptReference/Camera.RenderWithShader.html so your CopyFrom is probably not being applied. Try calling it from somewhere else. I don't think that's right, because this is attached to the Main Camera, the one rendering the top image. Which IS calling OnPreCull. The second camera on shaderCameraObject is being told to RenderWithShader() which will not call OnPreCull(), but that is irrelevant to the Main Camera. To be sure, I changed the code to LateUpdate and it did not fix the problem.
Jan 22 '11 at 02:39 AM
JonManatee
could you upload a scene package with just the relevant components?
Jan 22 '11 at 02:59 AM
Bravini
(comments are locked)
|
|
Edit: Ooops, nm I misread the question sorry
(comments are locked)
|



Could you make a screen shot of the terrain in wireframe, depending on the zoom and relative size of the faces, it could have an impact.
Are you sure that your shader you're using for RenderWithShader is working correctly? Try to use a different shader and check the result (rendertexture). Can you post the shader you use? And does this happens with other geometrie? (something other than terrain). Like Jean said, give us a screen shot with wireframe or a simpler scene that have the same issue.