Jump to content
  • Advertisement
Sign in to follow this  
skyman_cn

OpenGL How to Use NV_vertex_program3 in GLSL

This topic is 3789 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 all, I want to use NV_vertex_program3 in GLSL. The spec says that one should add OPTION NV_vertex_program3; at the begin of the vertex program. But when I added it to my GLSL vertex shader code, the program generated errors as follows: (1) : error C0000: syntax error, unexpected ';' at token ";" (1) : error C0501: type name expected at token ";" (1) : warning C7022: unrecognized profile specifier "NV_vertex_program3" (1) : warning C7022: unrecognized profile specifier "OPTION" (3) : warning C7537: OpenGL does not allow 'varying' after a type specifier (3) : warning C7514: OpenGL does not allow varying of type error (10) : error C0000: syntax error, unexpected identifier at token "vec4" (10) : error C0501: type name expected at token "vec4" ... My video card is NV Geforce 7300 GT, and the driver is Forceware 169.21. Can anyone tell me how to use NV_vertex_program3 in GLSL? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Quote:

I want to use NV_vertex_program3 in GLSL.

You can't. NV_vertex_program3 is for ASM shaders, not for GLSL.

Share this post


Link to post
Share on other sites
And what you need from NV_vertex_program_3? Most features of it are already supported by GLSL, such as Vertex Texture Fetch, and texture sampling with lod, bias and projective ones.

Share this post


Link to post
Share on other sites
The nvidia driver can decide the most optimal binary to generate so there isn't much of a need for the asm extensions.

*** actually, nvidia converts the GLSL to one of those asm targets and from there it optimizes and generates a binary which goes to the GPU.

Share this post


Link to post
Share on other sites
Thanks, everyone.
I use Vertex Texture Fetch of NV_vertex_program3.
When I run my program in my notebook PC, it runs OK, its video card is NV GeForce 8300. But when I run the program in my desktop PC, it runs Error, its video card is NV GeForce 7300. The Error is:

Vertex info
-----------
Internal error: assembly compile error for vertex shader at offset 11149:
-- error message --
line 468, column 27: error: too many instructions
-- internal assembly text --
!!ARBvp1.0
OPTION NV_vertex_program3;
# cgc version 2.0.0018, build date Dec 5 2007
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile vp40
#program main

...

It saids: "too many instructions", and it seems that the driver compiles the GLSL in VP4.0. Is the max instructions count of GeForce 8300 more than GeForce 7300 for VP4.0?

By the way, see "!!ARBvp1.0" , does it mean using vp1.0? Why not ""!!ARBvp2.0"? :)

Thanks a lot!

Share this post


Link to post
Share on other sites
Gf 7300 is a SM 3 GPU and the VS instruction limit is 512.
Gf 8 is 64K

There is no !!ARBvp2.0 so NV uses ARBvp1.0 and inserts their custom instructions that's why there is a OPTION NV_vertex_program3; in there.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Gf 7300 is a SM 3 GPU and the VS instruction limit is 512.
Gf 8 is 64K

There is no !!ARBvp2.0 so NV uses ARBvp1.0 and inserts their custom instructions that's why there is a OPTION NV_vertex_program3; in there.


Oh, I c. Thank you very much.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!