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

Reply via email to