3D model not lit in scene #2393
Replies: 3 comments 1 reply
-
Is your ribbon somewhere under the SkyNode in the scene graph? (BTW, toggling lighting is shaderland is accomplished by calling |
Beta Was this translation helpful? Give feedback.
-
I changed to Here is my code for setting up the trail node...
The vertices and normals of the trail are added and removed dynamically as the aircraft flies along. Perhaps I'm doing something out of order or incorrect above? As I mentioned before, the trail draws and looks correct except for it not being lit. |
Beta Was this translation helpful? Give feedback.
-
Honestly you shouldn't need to call Lighting or even generate a shader. Do me a favor and try using the "GL" sky; you can activate this with the |
Beta Was this translation helpful? Give feedback.
-
I have a need for rendering a 3D trail ribbon behind an aircraft model during flight somewhere on the Earth (mapNode is geocentric round Earth). I have successfully developed a 3D model that renders the ribbon using a triangle strip in localized world space, however, the model is not lit by the SkyNode like the 3D aircraft model that has the ribbon attached to it.
I have verified that the geometry is correct along with normals bound per vertex and global color. On the trail itself, I have run
ShaderGenerator gen;
gen.run(trail.get());
Lighting is enabled on the trail node as
trail->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::ON);
Yet the trail model is still not lit.
Do I need to write my own shader in order for lighting to work on the trail model?
Beta Was this translation helpful? Give feedback.
All reactions