Graphics next steps

6 views
Skip to first unread message

Harald Scheirich

unread,
Apr 22, 2014, 1:20:58 PM4/22/14
to openSurgSim
This is to solidify some ideas that have been brought out by current developments, and the way things have been moving. 

Currently in the works is a change that makes the group class internal to the graphics manager. This lets us be a bit more flexible in the way we configure groups and the way we assign things to groups. We will keep the default group functionality but replace it with a default name. I think by manipulating names externally, or groups internally we will be able to configure the pipeline a little bit better. A group won't be a component anymore.

In respect to removing functionality from sceneelement, we should move the functionality that is in the viewelement into the viewcomponent, this way we can not only get rid of the specific viewelement but also the osgviewelement, as there is already an osgview. 

The third change is a little bit more involved but it will cleanup our handling of shader parameters and bring it more in line with the rest of the system, when you look at the graphics example there are a lot of 'uniforms' that need to be created and assigned to materials, communication with the shaders is done via those uniforms and the uniforms have to be correctly typed, making this setup very brittle in respect to the shaders themselves and their parameters. 

I propose promoting the material to a component, and making it responsible for its' shaders' own uniforms and then connecting to those values through the materials property interface. e.g. 

Given a shader with a uniform named 'testUniform' you currently have to:

Create a material
Create the shader
Load the shader source
Assign the shader to the material
Create a uniform with the name 'testUniform' with the correct type
Assigne the uniform to the material

To change the value of the uniform testUniform in the shader, you would have to call setValue in the create Uniform

I would like to handle value propagation and uniform creation inside the material object, the given workflow would be 

Create a material
Create the shader
Load the shader source
Assigne the shader to the material 
At this time the material parses the shader and extracts the uniforms and their types, it will create the correct uniforms and 



--
Harald Scheirich
Principal Software Engineer
Simquest Solutions Inc. 
Reply all
Reply to author
Forward
0 new messages