PDA

View Full Version : Is progr. pixel shading same as hlsl and same as programmable fragment shading?



BigShooter
07-30-2003, 11:44 AM
Is programmable pixel shading, the same as programmable fragment shading and the same as hlsl?
Getting a bit confused :-(
How does the OpenGL programmable pixel shading compare with the one in DirectX?
Is there a hlsl (high level shading language) extension for OpenGl? Is there one fr Direct X?
Thank you,
Luke

JanHH
07-30-2003, 03:07 PM
Is programmable pixel shading, the same as programmable fragment shading and the same as hlsl?
Getting a bit confused :-(
How does the OpenGL programmable pixel shading compare with the one in DirectX?
Is there a hlsl (high level shading language) extension for OpenGl? Is there one fr Direct X?
Thank you,
Luke

"pixel" and "fragment" is the same, a pixel shader mentioned in a game magazine is the same as a fragment program.

and these are hardware capabilities, while hlsl is a language to program these.

and concerning the comparions of ogl vs d3d at these aspects, fragment shaders (*g*) are HARWDARE abilities, while ogl and d3d simply give you the utilities to access these capabilities.

and I am quite sure that both of them support everything the hardware has to offer, so they are about the same in terms of fragment shading capabilities.

Jan

BigShooter
07-30-2003, 03:22 PM
OK, then if Opengl already has fragment shaders (programmable pixel shaders) then why is this talk with high-level shading language (Opengl hlsl) making it to v2.0? Isn't hlsl the same as a way of programming hardware ability to do pixel shading?
:-(
Thank you Jan,
Luke

JanHH
07-30-2003, 04:19 PM
the reason is: continously making things better. there are extensions for fragment programs, but with these you have to program the gpu in assembler, what most people don't like. a high level shading language is a high level language (as the name suggests), that gets compiled to gpu assembler.

BigShooter
07-30-2003, 04:53 PM
Jan, does the DirectX have high level shading language?
hmmm... but there already is a high level shading language for OpenGL, provided by NVidia, such as cG, right?
But I guess that only works with Nvidia cards (only FX line?)
Thank you again Jan,
Luke

JanHH
07-30-2003, 06:11 PM
well I am not an expert in these things, I guess other people know a lot more than me http://www.opengl.org/discussion_boards/ubb/wink.gif.

especially I don't know very much about directx.

But I guess that cg is only for nvidia, glslang was developed by 3d labs and there is/was some concurrency between them. glslang will only run properly with radeon 9500/ gf fx due to the pixel shader specification. I think the gf4 also has pixel shaders, but ones that do not meet these specifications (althoug I might be wrong). I think those would run with cg, however.

Well. try http://www.opengl.org/discussion_boards/ubb/wink.gif.

kehziah
07-30-2003, 11:20 PM
Originally posted by JanHH:
"pixel" and "fragment" is the sameNot exactly. A pixel is a color element of the framebuffer. A fragment is more than this : it has color, depth, tex coords... Several fragments can be used to create a pixel.


Originally posted by JanHH:
fragment shaders (*g*) are HARWDARE abilitiesNo. Fragment shaders are custom instruction sequences performed at the fragment level. Whether they are executed in hardware or emulated on the CPU does not change their nature.


Originally posted by BigShooter:
Jan, does the DirectX have high level shading language?
Yes, it's called HLSL, and is available since D3D 9.


hmmm... but there already is a high level shading language for OpenGL, provided by NVidia, such as cG, right?
But I guess that only works with Nvidia cards (only FX line?)
Cg is API-independent. Shaders written in Cg can then be translated into API-specific code. For the moment, the Cg compiler supports D3D's HLSL, OpenGL's ARB_fragment_program, and NVIDIA-specific NV30 (FX family) OpenGL extensions.


why is this talk with high-level shading language (Opengl hlsl) making it to v2.0?The argument is about making the OpenGL Shading Language (glslang) a part of the core or not. Some believe that OpenGL should only define assembly-like language, and higher-level languages should be defined on top of it (like Cg today). Other prefer to have a built-in high level language shipped with OpenGL. For now, glslang stays outside of the core and is defined as an extension.

BigShooter
07-30-2003, 11:30 PM
Kehziah, how does cG compare to glshade?
Whatabout cg or glshade to HLSL of DirectX ?
After I understand OpenGL, I'd love to play around with some shaders :-)
Thanks,
Luke

kehziah
07-30-2003, 11:45 PM
Cg is API-independent. HLSL and glslang are API-specific. (btw, I made a mistake in my previous post : Cg can be compiled into DX pixel shaders (assembly-like language), not HLSL). Apart from that, they are very similar. Once you are comfortable with one of them, you can switch to another easily. It's really more the concepts behind programmability that are interesting rather than the language in which you express them (apart from the low vs high language debate, which is pointless IMHO).

BigShooter
07-30-2003, 11:52 PM
Thank you for all the help.

JanHH
08-01-2003, 06:43 AM
of course, fragment shaders can be implemented in software, but you will not want to use them in this case. what i meant was that useable pixel shaders are there because the hardware supports them, not because the api wants them to be there.