- Home /
OnWillRenderObject without renderer?
Hi,
I want to write code to basically implement my own renderer :
void OnWillRenderObject()
{
//Logic with Camera.current
Graphics.DrawMesh(....)
}
However, if I don't have a renderer attached to the GameObject, I don't get the call. Does anyone know of a way to do logics such as these?
Found this one as well, but with another purpose. Adding an empty mesh renderer didn't seem to help.
Answer by jonas-echterhoff · Nov 22, 2011 at 10:01 AM
OnWillRenderObject will not be called on your empty MeshRenderer, because, being empty, the mesh won't pass through culling. The best place to implement such custom rendering logic is probably Camera.OnRenderObject().
Your answer
Follow this Question
Related Questions
RaycastHit.textureCoord --- does the reverse exist? 2 Answers
Simple LOD script problem (switching mesh at runtime) 1 Answer
More vertex or more texture ? 0 Answers
iOS Crash - s_SkinVertices4Bones_Tangents_NEON_loop 0 Answers
Performance using Mesh from importet .obj file against Mesh created with Graphics Class 1 Answer