EOL" vec3 aLight = occLight_Position (theId).xyz;"
EOL" if (occLight_IsHeadlight (theId) == 0)"
EOL" {"
- EOL" aLight = vec3 (occWorldViewMatrix * occModelWorldMatrix * vec4 (aLight, 1.0));"
+ EOL" aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));"
EOL" }"
EOL" aLight -= thePoint;"
EOL
EOL" vec3 aSpotDir = occLight_SpotDirection (theId).xyz;"
EOL" if (occLight_IsHeadlight (theId) == 0)"
EOL" {"
- EOL" aLight = vec3 (occWorldViewMatrix * occModelWorldMatrix * vec4 (aLight, 1.0));"
- EOL" aSpotDir = vec3 (occWorldViewMatrix * occModelWorldMatrix * vec4 (aSpotDir, 0.0));"
+ EOL" aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));"
+ EOL" aSpotDir = vec3 (occWorldViewMatrix * vec4 (aSpotDir, 0.0));"
EOL" }"
EOL" aLight -= thePoint;"
EOL
EOL" vec3 aLight = normalize (occLight_Position (theId).xyz);"
EOL" if (occLight_IsHeadlight (theId) == 0)"
EOL" {"
- EOL" aLight = vec3 (occWorldViewMatrix * occModelWorldMatrix * vec4 (aLight, 0.0));"
+ EOL" aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 0.0));"
EOL" }"
EOL
EOL" vec3 aHalf = normalize (aLight + theView);"
EOL" vec3 aLight = normalize (occLightSources[1].xyz);"
EOL" if (occLight_IsHeadlight (0) == 0)"
EOL" {"
- EOL" aLight = vec3 (occWorldViewMatrix * occModelWorldMatrix * vec4 (aLight, 0.0));"
+ EOL" aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 0.0));"
EOL" }"
EOL
EOL" vec3 aHalf = normalize (aLight + theView);"
return;
}
- GLint aPlanesNb = 0;
- for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
- anIter.More(); anIter.Next())
- {
- const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
- if (!myContext->Clipping().IsEnabled (aPlane))
- {
- continue;
- }
-
- ++aPlanesNb;
- }
- if (aPlanesNb < 1)
+ const GLint aNbPlanes = Min (myContext->Clipping().NbClippingOrCappingOn(), THE_MAX_CLIP_PLANES);
+ theProgram->SetUniform (myContext,
+ theProgram->GetStateLocation (OpenGl_OCC_CLIP_PLANE_COUNT),
+ aNbPlanes);
+ if (aNbPlanes < 1)
{
return;
}
OpenGl_Vec4 anEquations[THE_MAX_CLIP_PLANES];
GLuint aPlaneId = 0;
- for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes());
- anIter.More(); anIter.Next())
+ for (OpenGl_ClippingIterator aPlaneIter (myContext->Clipping()); aPlaneIter.More(); aPlaneIter.Next())
{
- const Handle(Graphic3d_ClipPlane)& aPlane = anIter.Value();
- if (!myContext->Clipping().IsEnabled (aPlane))
+ const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIter.Value();
+ if (aPlaneIter.IsDisabled())
{
continue;
}
++aPlaneId;
}
- theProgram->SetUniform (myContext,
- theProgram->GetStateLocation (OpenGl_OCC_CLIP_PLANE_COUNT),
- aPlanesNb);
theProgram->SetUniform (myContext, aLocEquations, THE_MAX_CLIP_PLANES, anEquations);
}