hi sorry for the late !Emil_halim wrote:Xeus32
i have the same problem , so that i have changed SL to CG.
here is your shader program but with CG works fin with me.Code: Select all
void Vmain( float4 position : POSITION, out float4 oPosition : POSITION, out float2 oTexCoord : TEXCOORD) { float2 P = sign( position.xy ); oPosition = float4( P.x,-P.y ,0.0, 1.0 ); oTexCoord = P * 0.5 + 0.5; } void Fmain( float2 TexCoord : TEXCOORD, out float4 color : COLOR, uniform sampler2D txtr : texunit0) { float4 col = tex2D(txtr, TexCoord); float intensity = col.r * 0.299 + col.g * 0.587 +col.b * 0.184 ; color = float4(intensity, intensity, intensity,col.a) ; }
the code don't compile il the program name is not mane!
so change Fmain in main and Vmain in main!
if not work use this code! It work perfectualy
Vertex
Code: Select all
uniform sampler2D Texture0;
uniform float viewport_inv_width;
uniform float viewport_inv_height;
varying vec2 texCoord;
void main(void)
{
vec2 P = sign( gl_Vertex.xy );
gl_Position = vec4( P, 0.0, 1.0 );
texCoord.x = 0.5+ 0.5*(P.x ) ;
texCoord.y = 0.5+ 0.5*(P.y ) ;
}
Code: Select all
uniform sampler2D Texture0;
varying vec2 texCoord;
void main(void)
{
vec4 color = texture2D(Texture0,texCoord);
float intensity = color.r * 0.299 + color.g * 0.587 +color.b * 0.184 ;
gl_FragColor = vec4(intensity, intensity, intensity,color.a) ;
}
I signalled the bug and the necessity to change glCopyTexSubImage2D in setRenderTarget ( COpengldriver.cpp:2443) with direct render to texture as explain in http://developer.nvidia.com/attach/6725( Page 18 )! This change can permit to use high quality filtering over opengl.
If you need other help i can send my source and FX file for RenderMonkey!
Good Works at all!
(Sorry for my very bad English)