Jump to content

  • Log In with Google      Sign In   
  • Create Account

how to start with geometry shader (in cg) ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Titan.   Members   -  Reputation: 159

Like
0Likes
Like

Posted 04 April 2013 - 10:42 AM

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 ?

 



Sponsor:

#2 Titan.   Members   -  Reputation: 159

Like
0Likes
Like

Posted 11 April 2013 - 06:01 AM

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

people knowing it have to have learned it somewhere



#3 spek   Prime Members   -  Reputation: 997

Like
0Likes
Like

Posted 14 April 2013 - 09:41 AM

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



#4 Titan.   Members   -  Reputation: 159

Like
0Likes
Like

Posted 19 April 2013 - 08:37 AM

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 ;)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS