Sign in to follow this  

Generalized Displacement Mapping

This topic is 4556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear graphic programmers, Anyone have read or implemented "Generalized Displacement Maps", paper in Eurographics 2004. Here is the link: http://cg.cs.tsinghua.edu.cn/~shimin/pdf/esr_wx.pdf I'm trying to implement this paper and I have difficulties on it. Could somebody help? Here are the steps that we require to do (in my understanding): 1. Create a volumetric texture in 3D array, something like VolTexture[][][] to record some property in it. 2. Compute GDM for all x in VolTexture for all y in VolTexture for all z in VolTexture for all viewing direction (theta,phi) GDM[x][y][z][theta][phi] = computeGDM(x,y,z,theta,phi); 3. Let say you want to map this texture to a triangle, so we must extrude this triangle to a prism (along the normal) 4. Use PixelShader to shade it PixelShading(Pin,Tin) compute exit point(Pout,Tout) of ray segment in prism compute texture space length dt = |Tout-Tin| of ray segment compute view direction Vt in texture space query the GDM value dGDM(Tin,Vt) of p if (dGDM < dt) compute texture coordinate T of intersection point shading computation else no intersection My questions are: 1. How do we get Pin and Tin? Let say that we form the extruded prism (manually) by calling these functions: // base glVertex3f(0.0,0.0,0.0); glVertex3f(1.0,0.0,0.0); glVertex3f(0.0,0.0,1.0); // side glVertex3f(0.0,0.0,0.0); glVertex3f(0.0,1.0,0.0); glVertex3f(0.0,1.0,1.0); glVertex3f(0.0,0.0,0.0); glVertex3f(0.0,1.0,1.0); glVertex3f(0.0,0.0,1.0); // side glVertex3f(0.0,1.0,1.0); glVertex3f(0.0,0.0,1.0); glVertex3f(1.0,1.0,0.0); glVertex3f(0.0,0.0,1.0); glVertex3f(1.0,0.0,0.0); glVertex3f(1.0,1.0,0.0); // side glVertex3f(0.0,0.0,0.0); glVertex3f(0.0,1.0,0.0); glVertex3f(1.0,1.0,0.0); glVertex3f(0.0,0.0,0.0); glVertex3f(1.0,0.0,0.0); glVertex3f(1.0,1.0,0.0); // top glVertex3f(0.0,1.0,0.0); glVertex3f(1.0,1.0,0.0); glVertex3f(0.0,1.0,1.0); How do I get the texture coordinate (Tin), since now the texture is volumetric texture? 2. How do we compute (Pout,Tout)? thanks a lot regards, Stephanus

Share this post


Link to post
Share on other sites
hmm if i understood that right you're simply asking for the second intersection point of a ray going through a prisma with a triangle as the base..

i'm not that good at maths but i think most people in the math forum are able to help you...

regards,
m4gnus

Share this post


Link to post
Share on other sites

This topic is 4556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this