Jump to content
  • Advertisement
Sign in to follow this  
tobitobsen

OpenGL OpenGl with Geforce 8800. SM 4.0???

This topic is 4212 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
You need to enable the sm 4.0 extensions with a perprocessor command
#extension GL_EXT_gpu_shader4 : enable

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
Doesn't work on my pc either. I don't think this is possible yet. Anyway why do you need 17 textures in a shader?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!