We have just released a new version of the scene graph Gizmo3D with full support for GLSL combined with ARB vp/fp. Would like some feedback of our hierarchical model of state changes that uses the shaders. Feel free to download and try at www.gizmosdk.se (http://www.gizmosdk.se) for win32, Irix,Mac OS X and linux.

Dirk

05-02-2004, 07:34 AM

Originally posted by ToolTech:
We have just released a new version of the scene graph Gizmo3D with full support for GLSL combined with ARB vp/fp. Would like some feedback of our hierarchical model of state changes that uses the shaders. Feel free to download and try at www.gizmosdk.se (http://www.gizmosdk.se) for win32, Irix,Mac OS X and linux.It sounds interesting, but I couldn't find much info about that, and it wasn't obvious from the headers. Can you give us a quick overview of how you integrated shaders in your system?

Thanks

Dirk

P.S.: It is a cross-over topic, but I think it would be more appropriate for the Scenegraphs Forum.

ToolTech

05-03-2004, 05:56 AM

Here is a program that uses either OpenGL Shaders or ARB fp/vp in parallell.

// Create some light environment group. This way we get lighting into the model
// All stuff under this is lit with material s etc.
gzEnvironment *group=new gzEnvironment;

// Create a backface culling state
// We don't want to render backfaces. this way we can "force" the geoms to be rendered without
// backfaces. It also enable the use of the shaders

m_state=new gzState;

m_state->setMode(GZ_STATE_POLYGON_MODE,GZ_STATE_ON);
m_state->setBackPolygonMode(GZ_POLYGON_MODE_CULL);
m_state->setFrontPolygonMode(GZ_POLYGON_MODE_FILL);
m_state->disableAllNonEnabledModes(); // We need this for the top global state

// Add some dynamic light
m_spin=new gzLight; // This is the lamp that we move around
m_spin->setSpecularColor(0.2f,0.2f,0.2f);
m_spin->setDiffuseColor(0.5f,0.5f,0.5f);
m_spin->setAmbientColor(0.3f,0.3f,0.3f);
m_spin->setPosition(26,10,90);

// Now we want to look at the scene. Grab the default perspective camera from the window and set the scen as the
// active one.
getCamera()->setScene(m_scene);
getCamera()->setNearClipPlane(1);
getCamera()->setFarClipPlane(2000);

// Lets add some movement to the scene

m_input=new gzSimpleMouseViewControl(getCamera());

addInputInterface(m_input);

// Hmm. trivial
setBackground(0.0f,0.0f,1.0f,1.0f);

// and show us ...
show();

// hm. wonder why I put this one here ?
angle=2.22f;

};

/*
The following code snippet is a virtual function to catch the window messages
for pressed, repeated and released keys
*/