Scene Graph Shading Language

There are some discussions right now going on for fx functions in GLSL.

My spontaneous reaction is … " Thats exactly what we are doing in the scene graph"

So my concern is now that we (creators of scene graphs) could get together and discuss how this would be fitted in a scene graph for the best way.

E.g. Is there a typical multieffect node that contains the shaders for each pass.

How is this described in external formats that suits our scene graphs.

How do you add GLSL to e.g. OpenFlight formats comments… etc…

What built in uniforms should be available for the shaders from the scene graph (pass,time,lod level etc)

Any thoughts ?

/Anders Modén (www.gizmosdk.se)

Example … The following built in vars are now defined by Gizmo3D

uniform float renderTime;	// Built in by Gizmo3D = (seconds since hour started for current rendering)

uniform mat4 currentInvertedTransform;		// Built in by Gizmo3D = inv(gl_ModelViewMatrix)
uniform mat4 mainInvertedProjTransform;		// Built in by Gizmo3D = inv(gl_ProjectionMatrix)

  

Yeee… A lot of thoughts here from other scene graph creators :wink:

Well I will try anyway…

What about shared global uniforms that can be use by multiple shaders. The user changes a global var and multiple shaders get affected…

What about design patterns for adding vertex attributes that works for both ARB fp & vp and glsl as well as future gen shaders.

Really looking forward to discuss these matters. We will release 1.2 in a couple of days and then you can try our scene graph shader implementation.

Originally posted by ToolTech:
[b]Yeee… A lot of thoughts here from other scene graph creators :wink:

Well I will try anyway…

What about shared global uniforms that can be use by multiple shaders. The user changes a global var and multiple shaders get affected…

What about design patterns for adding vertex attributes that works for both ARB fp & vp and glsl as well as future gen shaders.

Really looking forward to discuss these matters. We will release 1.2 in a couple of days and then you can try our scene graph shader implementation.[/b]
Hi Anders,

Sorry about no comment so far, been rather busy writing a scene graph to comment on it… :slight_smile:

Currently the OSG has its own FX node kit, osgFX which allows you to compose effects from different techniques, the technique chosen depend upon the OpenGL extension available, these extensions include OpenGL Shader Language (via the osgGL2 lib will soon be brought into the core osg library) and the ARB_vertex_program/fragement_program.

When we integrate the Shader Language support directly into the core I intend to revamp the state management a little to make it better map Shander Language functionality, as to exactly this will be I can’t say until I get my hand dirty.

Out there on the horizon would be managing shader state at a more fine grained level allowing shaders to be mixed and matched more freely, a bit more akin to the way tradition OpenGL modes and state attributes are manged right now. This is one on the neat things about the SL and differentiates it from Cg/HLSL, and is a flexbility that will suite scene graphs well.

Good luck with your 1.2 release.

Robert.

Thanx Robert !

I was hoping for some comment from you :wink:

When you feel more ready for it. Lets discuss state management and built in vars to exchange data between scene graph and shaders…

Se ya…

Originally posted by ToolTech:
[b]Thanx Robert !

I was hoping for some comment from you :wink:

When you feel more ready for it. Lets discuss state management and built in vars to exchange data between scene graph and shaders…

Se ya…[/b]
I’ll be speaking at the “Applied Virtual Reality III” conference and workshop, hosted by Charlmers Unvervisty, Gorthernburg from the 26-28th May.

 [http://www.ckk.chalmers.se/vr/avriii/](http://www.ckk.chalmers.se/vr/avriii/) 

If you can make it, then with other attendees we could contribute to a general discussion about this issue.

Robert.

Originally posted by Robert Osfield:
I’ll be speaking at the “Applied Virtual Reality III” conference and workshop, hosted by Charlmers Unvervisty, Gorthernburg from the 26-28th May.

http://www.ckk.chalmers.se/vr/avriii/

If you can make it, then with other attendees we could contribute to a general discussion about this issue.

Robert.[/QB]
Sounds like a plan. I’ll be there.

See you soon

Dirk

Sounds like a good idea !

I will try to get there. Any day specific ?

BTW. We have just released the “final” 1.2 of our API Gizmo3D so you can check out the shader implementation there at www.gizmosdk.com

You can see pre defined built in vars, full support for hierarchical shaders where you can “replace” parts fo the shader as you traverse down the scene. OPtimized state switches that uses shaders just like texture and other states to optimize rendering.

Originally posted by ToolTech:
[b]Sounds like a good idea !

I will try to get there. Any day specific ?
[/b]
I’ll be there from Wednesday to Sunday due to flight reasons, so I’m pretty open. If you’re looking at a specific conference date, Friday morning seems to be mainly Swedish, which I won’t be able to follow, so that would be a good time. Otherwise Friday afternoon would work, too (the workshop ends at 15:00).

[b]
BTW. We have just released the “final” 1.2 of our API Gizmo3D so you can check out the shader implementation there at www.gizmosdk.com

You can see pre defined built in vars, full support for hierarchical shaders where you can “replace” parts fo the shader as you traverse down the scene. OPtimized state switches that uses shaders just like texture and other states to optimize rendering.[/b]
Can you give me a hint on where to look? I downloaded the latest version a couple days ago, but couldn’t really find the interesting parts. :wink:

See you soon

Dirk

You can check out the example “ir_shader” or the example “shaders” that shows the usage of gzGFXProgram. You just do

gzGFXProgram::loadScript(xxx)

and then set the gzState with the gzState::setProgram(yy)

The system can register new or custom program managers. The GLSL or ARB FP/VP is built in and checks the sysntax of the script to see if they shall be activated.

The examples are pretty basic but they show how to set up vertex attributes and uniforms that works with both GLSL and ARB VP/FP or even your own software shader implementation.