Sign in to follow this  
tobitobsen

OpenGL OpenGl with Geforce 8800. SM 4.0???

Recommended Posts

Hi! The Spec says that you can use 128 pixel textures on a Geforce 8 (http://www.nvidia.com/object/IO_37100.html) -> Pixel Shader Model 4.0 If I want to use a GLSL shader with more than 16 samplers, I will get the error message "Sampler limit exceeded; more than 16 samplers needed to compile program"... This limitation of 16 samplers comes from SM 3.0... Does someone know, how to compile the shader for SM 4.0???? Thanks, Tobi

Share this post


Link to post
Share on other sites
Hi,

thanks for your advise Ingrater, but it doesn't work.... :(

I have written a little test program.... it defines 17 sampler vars....
The compiler says
"error C6012: Sampler limit exceeded; more than 16 samplers needed to compile program"

Damn it! Other ideas....? it must be possible....

Tobi




#extension GL_EXT_gpu_shader4 : enable

uniform sampler2D test1;
uniform sampler2D test2;
uniform sampler2D test3;
uniform sampler2D test4;
uniform sampler2D test5;
uniform sampler2D test6;
uniform sampler2D test7;
uniform sampler2D test8;
uniform sampler2D test9;
uniform sampler2D test10;
uniform sampler2D test11;
uniform sampler2D test12;
uniform sampler2D test13;
uniform sampler2D test14;
uniform sampler2D test15;
uniform sampler2D test16;
uniform sampler2D test17;

void main(void)
{
gl_FragColor = texture2D(test1, vec2(0.5, 0.5)) +
texture2D(test2, vec2(0.5, 0.5)) +
texture2D(test3, vec2(0.5, 0.5)) +
texture2D(test4, vec2(0.5, 0.5)) +
texture2D(test5, vec2(0.5, 0.5)) +
texture2D(test6, vec2(0.5, 0.5)) +
texture2D(test7, vec2(0.5, 0.5)) +
texture2D(test8, vec2(0.5, 0.5)) +
texture2D(test9, vec2(0.5, 0.5)) +
texture2D(test10, vec2(0.5, 0.5)) +
texture2D(test11, vec2(0.5, 0.5)) +
texture2D(test12, vec2(0.5, 0.5)) +
texture2D(test13, vec2(0.5, 0.5)) +
texture2D(test14, vec2(0.5, 0.5)) +
texture2D(test15, vec2(0.5, 0.5)) +
texture2D(test16, vec2(0.5, 0.5)) +
texture2D(test17, vec2(0.5, 0.5));
}

Share this post


Link to post
Share on other sites
If you realy need that much textures why don't you use the new texture object array extension? So you can use for example for every texture channel 16 1024x1024 Textures, that would make 16x16 Textures = 256 Textures, that should be enough :D

Share this post


Link to post
Share on other sites
Hi,

this is a good suggestion.... I get a warning that I must add "#version 110" for using "ARB_texture_rectangle"....
I will swap "#version 110" with "#version 120".... I hope this will solve my problem....

I can't check it at the moment, because I don't have a gf 8 at home but I am looking forward to Monday.... :)

Have a nice weekend,

Tobi

Share this post


Link to post
Share on other sites
Hello,

Damn it!
I have changed the shader but it still doesn't work.... :(

Can please somebody with a GeForce 8 verify the shader....
Do I need further GL commands (like glEnable(..))?
I have the latest driver from NVIDIA installed...

Cheers,
Tobi

-----------

#extension GL_EXT_gpu_shader4 : enable
#version 120


uniform sampler2D test1;
uniform sampler2D test2;
uniform sampler2D test3;
uniform sampler2D test4;
uniform sampler2D test5;
uniform sampler2D test6;
uniform sampler2D test7;
uniform sampler2D test8;
uniform sampler2D test9;
uniform sampler2D test10;
uniform sampler2D test11;
uniform sampler2D test12;
uniform sampler2D test13;
uniform sampler2D test14;
uniform sampler2D test15;
uniform sampler2D test16;
uniform sampler2D test17;

void main(void)
{
gl_FragColor = texture2D(test1, vec2(0.5, 0.5)) +
texture2D(test2, vec2(0.5, 0.5)) +
texture2D(test3, vec2(0.5, 0.5)) +
texture2D(test4, vec2(0.5, 0.5)) +
texture2D(test5, vec2(0.5, 0.5)) +
texture2D(test6, vec2(0.5, 0.5)) +
texture2D(test7, vec2(0.5, 0.5)) +
texture2D(test8, vec2(0.5, 0.5)) +
texture2D(test9, vec2(0.5, 0.5)) +
texture2D(test10, vec2(0.5, 0.5)) +
texture2D(test11, vec2(0.5, 0.5)) +
texture2D(test12, vec2(0.5, 0.5)) +
texture2D(test13, vec2(0.5, 0.5)) +
texture2D(test14, vec2(0.5, 0.5)) +
texture2D(test15, vec2(0.5, 0.5)) +
texture2D(test16, vec2(0.5, 0.5)) +
texture2D(test17, vec2(0.5, 0.5));
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this