PDA

View Full Version : Scene Graph Shading Language



ToolTech
05-05-2004, 10:43 PM
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)

ToolTech
05-06-2004, 04:18 AM
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)

ToolTech
05-11-2004, 12:24 PM
Yeee.. A lot of thoughts here from other scene graph creators ;-)

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.

Robert Osfield
05-13-2004, 12:23 AM
Originally posted by ToolTech:
Yeee.. A lot of thoughts here from other scene graph creators ;-)

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.Hi Anders,

Sorry about no comment so far, been rather busy writing a scene graph to comment on it... :-)

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.

ToolTech
05-13-2004, 02:13 AM
Thanx Robert !

I was hoping for some comment from you ;-)

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..

Robert Osfield
05-13-2004, 04:29 AM
Originally posted by ToolTech:
Thanx Robert !

I was hoping for some comment from you ;-)

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..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.

Dirk
05-17-2004, 11:57 AM
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

ToolTech
05-18-2004, 10:04 PM
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 (http://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.

Dirk
05-21-2004, 07:27 AM
Originally posted by ToolTech:
Sounds like a good idea !

I will try to get there. Any day specific ?
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).



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 (http://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.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. ;)

See you soon

Dirk

ToolTech
05-22-2004, 05:26 AM
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.