Hi David,
 
Just found out that the fault lies in my 3D model. Apparently, my shader only 
works for 3D models that are in OpenFlt format. It doesn't work for ive fomat. 
I've appended my shader code below:
 
uniform sampler2D tex;uniform float fAmp;
void main(){
   vec4 texelColor = texture2D(tex, gl_TexCoord[0].st);
   texelColor = texelColor * fAmp;
   gl_FragColor = texelColor;}
Thanks,
Cg
 



Date: Thu, 12 Jun 2008 16:46:04 +0200From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: Re: [osg-users] Shader ProblemHi CGWhen your remove a shader, "void 
Program::dirtyProgram()" is called to request a relink in the next 
frame.Program is relinked in the next frame in "void Program::apply( 
osg::State& state ) const" method.Follow your code in a debugger to see if all 
is properly done.Are you sure your shader is well removed from your program 
?HTHDavid Callu

2008/6/12 CG <[EMAIL PROTECTED]>:

Hi David, I'm using osg 2.4 and osgViewer. Regards,Cg


Date: Thu, 12 Jun 2008 11:09:49 +0200From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: Re: [osg-users] Shader Problem 


hi CGwhen you remove a shader, osg::Program need to be relinked.this is done by 
osgUtil::GLObjectVisitor in osgViewer::Renderer::draw method.So this seem can 
be done at runtime.Which OSG version did you use ?Did you use osgViewer ?David 
Callu
2008/6/12 CG <[EMAIL PROTECTED]>:

Hi all, Are there any ways to remove the shader during runtime? I've tried the 
removeShader function but the effect of the shader is still applied to my 
models (e.g tank) i.e. the appearance of the models do not go back to the state 
before shader is applied. Regards,Cg

Chat online and in real-time with friends and family! Windows Live 
Messenger_______________________________________________osg-users mailing 
[EMAIL 
PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Always-on security tools provide safer ways to connect and share anywhere. Find 
out more. Windows Live_______________________________________________osg-users 
mailing [EMAIL 
PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_________________________________________________________________
Easily publish your photos to your Spaces with Photo Gallery.
http://get.live.com/photogallery/overview
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to