# Generalized Displacement Mapping

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

## 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 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

1. 1
2. 2
3. 3
Rutin
21
4. 4
frob
18
5. 5

• 33
• 13
• 10
• 10
• 12
• ### Forum Statistics

• Total Topics
632568
• Total Posts
3007119

×