PDA

View Full Version : Are all vertex programs compatable with both DX and OpenGL?



WhatEver
05-06-2002, 04:24 PM
Can I use the DX asm tools and use them with OpenGL? I'm ready to start experimenting with these vertex and pixel shaders http://www.opengl.org/discussion_boards/ubb/biggrin.gif

davepermen
05-07-2002, 01:44 AM
not directly
go to your hardware vendor in the development section to find out how to expose your hardware features with the specific extensions..

nvidia:
GL_NV_vertex_program(1,1.1)
GL_NV_texture_shader(1,2,3)
GL_NV_register_combiners(1,2)

ati:
GL_EXT_vertex_shader
GL_ATI_fragment_shader

mcraighead
05-07-2002, 12:29 PM
NV_vertex_program was designed to be almost exactly compatible with DX8 vertex shaders.

- Matt

Lars
05-07-2002, 02:13 PM
NV_vertex_program was designed to be almost exactly compatible with DX8 vertex shaders.


There is still this "almost" :-)
I know there is a tool on the NVIDIA website which alows loading dx shaders in OpenGL directly. The tiny bit of documentation i found about it just mentioned that it doesn't support pixel shaders.
But are there Vertex Operations that can't be converted from dx to gl or gl to dx ?

Lars

WhatEver
05-07-2002, 02:43 PM
I don't understand why D3D has all the vertex program helpers and OpenGL has none...as far as I know. I need help getting started with vertex and pixel shaders in OpenGL but all the resources are revolving around D3D!

I know Nutty has some source examples, but I need to get my hands on a very informative white paper. Something that will walk you through step by step explaining what's happening. Without that I'm dead in the water. I've tried on several occasions to try and start learning this stuff, but have always quit because the info for doing it in OpenGL is just not there, or very well hidden.

So does anyone have links to some resources that can help me? I would extremely appreciate it if I could get some.

Thx,
Aaron Taylor

NitroGL
05-07-2002, 02:58 PM
Originally posted by mcraighead:
NV_vertex_program was designed to be almost exactly compatible with DX8 vertex shaders.

- Matt

Too bad it's not support on non-GeForce hardware. http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

WhatEver
05-07-2002, 03:03 PM
I went and dled Nuttys first sample vertex program...so I guess all I really need is just a paper that describes what the keywords mean and maybe some examples on how to do cross products and stuff.

mcraighead
05-07-2002, 04:53 PM
I would suggest the NV_vertex_program specification, if nothing else; it certainly has an example of how to do a cross product.
http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_program.txt

Search for "How do you perform a 3-component cross product in two instructions?"

- Matt

mcraighead
05-07-2002, 05:01 PM
Originally posted by Lars:
But are there Vertex Operations that can't be converted from dx to gl or gl to dx ?Lars

I *believe* that all possible DX8 programs can be trivially modified to work with VP1.0, and vice versa. VP1.1 programs may not necessarily be portable to DX8.

By 'trivially' I mean that all you need not do any extensive parsing or semantic or dataflow analysis of the program.

It should be possible to port from DX8 to ARB_vertex_program with not much more difficulty than porting to NV_vertex_program, but the reverse is likely not true.

I can't speak for automatic porting to/from EXT_vertex_shader, since I am not very knowledgeable about it, though I suspect it would be somewhat more difficult, because you would actually have to parse C source code (which might use other language constructs, like looping).

- Matt

WhatEver
05-07-2002, 07:12 PM
Awesome! Thx Matt!

Do you guys usually just write the programs yourself and not use any tools to create them for you like the one for D3D?

Does anyone know if someone is writing something similar to the D3D vertex compiler for OpenGL? That would be VERY handy.