-
Notifications
You must be signed in to change notification settings - Fork 124
Wireframe shading for SceneShapes, use Cs instead of vertexCs. #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wireframe shading for SceneShapes, use Cs instead of vertexCs. #400
Conversation
include/IECoreGL/Primitive.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the signature of this virtual method will break binary compatibility. Also, it will prevent the CurvesPrimitive and PointsPrimitive overrides from being picked up (because the signatures no longer match).
I do like the idea of reusing the existing constant shader instead of introducing another one that's almost the same. But in addition to my comments above, I don't think adding the extra arguments to |
src/IECoreGL/Primitive.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This search is now broken - it cannot know whether the setup it finds was created with vertexCsActive == true
or not, and can return the wrong one.
Since I can't think of a better alternative, I think we do need to introduce a new shader. I don't think it should be called |
Add new wireframe() shader in IECoreGL/Primitive.cpp |
c6583c7
to
21e94ed
Compare
I think the name |
Something like constant3(), seems ok ? |
I actually think the |
Yes, |
21e94ed
to
2e2b335
Compare
2e2b335
to
5ef1dcf
Compare
Fixed shader name and shader contents. |
Wireframe shading for SceneShapes, use Cs instead of vertexCs.
Actually, I merged this already, but one of the tests is failing, which I guess is saying that the "gl:primitive:wireframeColor" state isn't effecting wireframe renders anymore...
|
Whats strange is that loading up a scene in Gaffer, wireframeColor still seems to work as expected... Also, replacing the shader construction inside but replacing it with this still fails: and I was under the impression those two statements do the same thing... |
Instead of create a new shader wireframe(), who will be the same as the constant(), in IECoreGL/Shader.cpp. I guess, use the uniform argument "bool vertexCsActive" in defaultVertexSource() is more clear.
Because Shader::Setup is const in IECoreGL/Primitive.cpp, I can't add a uniform Parameter at "constantSetup" ( line:204). So I have choose to add a new argument into Primitive::addPrimitiveVariablesToShaderSetup(), "bool vertexCsActive".