how to start with geometry shader (in cg) ?

Started by
2 comments, last by Titan. 11 years ago

hello,

I have a lot of trouble to learn geometry shader, I work in cg and i haven't find any tutorial or usefull documentation about it.

from now i have read the nvdia's book: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter01.html, and implemented sucessfully nice looking lightning (with normal map, specular map, etc) and some animation.

but for geometry i only found some sample from nvida not commented and in ASM and some article about the concept and the purpose of it.

it took me a day to actually get a working simple pass through hello world:


TRIANGLE
void mainG(AttribArray<float4> position : POSITION)
{   
emitVertex(position[0] : POSITION, float4(1,0,0,1) : COLOR);
emitVertex(position[1] : POSITION, float4(0,1,0,1) : COLOR);
emitVertex(position[2] : POSITION, float4(0,0,1,1) : COLOR);
}
 

do you guys know any good reference that google don't ?

Advertisement

ok so no one know a blog or something explaining it..., and what about books ?

people knowing it have to have learned it somewhere

no very detailed code examples, but nevertheless, I wrote about it a long time ago (using Cg) so maybe this is useful:

http://tower22.blogspot.nl/2011/01/mega-structures-geometry-shaders-1.html?q=geometry+shader

http://tower22.blogspot.nl/2011/02/mega-structures-geometry-shaders-2.html?q=geometry+shader

http://tower22.blogspot.nl/2012/05/making-off-radar-demo-8-morphing.html?q=geometry+shader

and maybe it appears on a few more places. The boxes with code examples almost got unreadable after Blogger suddenly changed the lay-out but it shows various shaders anyway

thanks for your blog, I learned some stuff about GS, but it's a shame some functions like "rerestartStrip()" or just "emitVertex()", are defined nowhere on the nvidia's doc which seems actually only composed of gp4gp information and this unreadable ugly thing, I had to find these functions in random forum's code and figure out what they may do.

since my first post I started to learn glsl instead which is well documented and a lot more used, I'll maybe switch back to CG once i'm comfortable with shaders.

ps: I also learned a lot about deferred rendering on your blog and bookmarked it ;)

This topic is closed to new replies.

Advertisement