Archived

This topic is now archived and is closed to further replies.

ploiu

cg bump mapping...

Recommended Posts

CG, glslang, vertexprograms, fragmentprograms, env combiners, reg combiners...

everything here is about choise, i have several different ways to do bumpmaps, and i use different methods depending on the number of textures on the surface, the accuracy i need and what card i need it to work on.

most of the time i use vertexprograms + envcombiners and dot3 ( in the envcombine), its simple and works on several cards.. i also have versions that preforms real normalixation per pixel, and then i use fragment programs.. I dont like CG becourse the way it was meant to run ( according to me) that is, compile at runtime requires atleast an extra external dll (i cant use their .lib in delphi) and precompile to a vertexprogram doesnt give me anything for such simple shaders im writing at the moment. when glslang comes i think i will be using it as much as possible.

Still, CG is pretty nice, so if you like the syntax and dont want to hazzle with ASM, then use it..

Share this post


Link to post
Share on other sites
Yes, its possible to do that, its just that for runtime compilation you need an external dll ( and even exe i early versions), but in vc++ you can use a static linked .lib which is much nicer and cleaner, but delphi cannot handle the COFF format that the .lib is in.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
by the way... does anyone know any bump mapping demo using cg with opengl, thats uses those blueish normal maps, not height maps...?

Share this post


Link to post
Share on other sites
Doesnt all newer bumpmap demos use normalmaps ( those blue things , Only some old emboss bump can use heightmaps ( grey ) diretly. But the application can convert it on load..

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
CG is just one of many ways of configuring the hardware. Whether that''s the best way to configure hardware to do bump maps is up to your preference.

When it comes to how the hardware should be configured to do bumps, there are three theories:

1) use dsdt textures, which perturb a normal in tangent space
2) use normal maps, in object space or tangent space
3) use height fields, sample three times, and calculate normal

Number 3 is only practical on DX9 level hardware, but has some nice properties; for example, you can add heighfields together.

Share this post


Link to post
Share on other sites
Personally I like to write programs for the future. So I use all the most intensive top of the line stuff. Unfortunitly, most people can afford the necessary equipment, so they never can see the amazing creative world fragment (mainly) and vertex shaders open up. What a shame, there should be a law.

Anyways, that means I use shaders as much as I can, I toss the other ways because they are more passes involved and they are less flexible. Lets move into the future I say. Also, I only use cg, because that the best presently available language for shaders in OGL.

Share this post


Link to post
Share on other sites