Hi,

sorry, I cannot know what you are trying to do with the shader, but don't you need to init the texcoord you are using?

Something like
vec2 Texcoord = gl_TexCoord[0].xy;

I'd suggest trying to do a simple texture copy (or even just inserting a constant value) in the RTT camera for a start just to make sure everything is working.

jp

On 14/10/10 13:20, Aitor Ardanza wrote:
I don't know if this method helps me get what I want ...
RTT give me an image of the model from configured camera, but I need to take an 
image, like model texture, painting only specific areas defined in the fragment 
shader:


Code:
uniform vec2 textCoord;
uniform sampler2D baseMap;
uniform vec3 interPos;

varying vec3 Normal;
varying vec4 color;
varying vec2 Texcoord;
varying vec3 position;

void main( void )
{
     float radio = 3.0;
     vec3 a = position - interPos;
     float dist = sqrt((a.x*a.x)+(a.y*a.y)+(a.z*a.z));
     vec4 paintColor = vec4(1.0,0.0,0.0,1.0);
     vec4 col = texture2D( baseMap, Texcoord ) * color;
     if(dist<radio){
         gl_FragData[0] = texture2D( baseMap, Texcoord ) * color + paintColor;
         gl_FragData[1] = paintColor;
     }
     else{
         gl_FragData[0] = texture2D( baseMap, Texcoord ) * color;
         gl_FragData[1] = vec4(1.0,1.0,1.0,1.0);
     }
}



Any other idea????

Cheers,
Aitor

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32725#32725





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to