# bybw

Member

18

128 Neutral

• Rank
Member
1. ## Deferred SSDO

Thanks for the info. SH is just used to reconstruct occlusion function. The dot product between occlusion function and light vector is to calculate dirrectional occlusion from the light. Makes sense now,
2. ## Deferred SSDO

Hello! I've been reading this page recently, http://kayru.org/articles/dssdo/   The idea is quite straightforward and it's quite easy to replace existing ssao implementation. However, one thing really confused me was that the author said, 'the local occlusion function can be reconstructed by the dot product of occlusion coefficients and light vector'? AFAIK, if calculating diffuse lighting, we also need to project incoming light to the shpere, then do a dot product between both coefficients.   Just wondering why a simple dot product between occlusion coefficient and light vector is sufficient in this case. Anyone can help explain the math behind it? Or is there any paper describing the detail/trick? Thanks.
3. ## shadow map for transparent objects

It makes sense[smile] Another idea occurred to me, though i didn't find the tips you described above in d3d docs This time i'll use a RGBA render-target, then alpha test should work correctly. Trying to pack z value into a RGBA texture, and unpack it when doing z comparing pass but i wonder how to encode depth in rgba?
4. ## shadow map for transparent objects

@Ingenu the depth map is shown upper left @MikeWW if i enable alpha test and render the two leaves, i will get two black quads in depth map [Edited by - bybw on October 18, 2005 7:12:18 AM]
5. ## shadow map for transparent objects

i've got my shadow map working correctly. but when i started to render the shadow for my trees, i met another problem - how to handle with a transparent object, such as the leaves of a tree. so i wrote a simple demo just for a test. i render the depth map with the alpha info from the texture, and it works fine. but when i tried to add more leaves, the result was wrong, the alpha portion of an object culls the object below :( i'm using a FP texture as render target to do the first pass. i think with a GF3+ card, i can render the whole world in normal way, and get the DST quickly without such problem. but i'm using an ATI card...so any good idea? [Edited by - bybw on October 18, 2005 7:25:57 AM]
6. ## How to get the z buffer as a texture?

thanks for your replies. Quote:if you are thinking of trying to save the Z buffer to a texture, i don't think it can be done on a PC, or it's really slow. unfortunately, i want the depth texture updated every frame... i've read some shadow map issue it seems i should render the entire scene into a texture(render target) and calculate the z value with a shader
7. ## How to get the z buffer as a texture?

I want to get a z buffer texture with D3DFMT_A8R8G8B8. I've tried to use D3DXLoadSurfaceFromSurface(), but got a corrupt image. Any one knows how to do this? some samples would be better.

9. ## Setting up GLSL attributes

hi, you can use glMutiTexCoord or glVertexAttrib to pass them into your shader. Before using glVertexAttrib, remember bind the user defined attribute and link the program again.
10. ## Water Reflection Issue

almost the same problem here. i cant get the correct result when using oblique culling to modify the projection matrix. here is the one with clip plane, and it works perfectly. and if with oblique culling, the object just not flip correctly. when i rotate my camera to a certain angle, the object is culled which is of course wrong! it seems that i get the wrong projection matrix before modifying. it happened when the Yaw angle close with 90 and -90
11. ## reflection (use GLSL)solved

ok, solved the problem :) just made a mistake when calculating the texcoord in vs. the projtexcoord should be Mprojtex * inPos as Yann described in his article. [Edited by - bybw on January 1, 2005 6:02:33 AM]
12. ## reflection (use GLSL)solved

i render the reflection scene with pbuffer, then copy the image to the texutre. the RTT pass is right, cos i can get the correct result in fixed function pipeline. And the shader is ok, then there must be somethin' wrong in the second pass.. anyone found out some mistakes?
13. ## 3ds / milkshape keyframe animation?

ah, i imported a ms3d model into my project sometime before. Also, the animation stuff isn't an easy job. you can find a tutorial about the anim here. gametutorial would be a good place to learn something about 3ds. Hope that helps! Cheers, Chaz
14. ## reflection (use GLSL)solved

hello, i've got the my reflection work in fixed pipeline, but i met some trouble when using shader. the reflection texture is already stored in ref_tex and set to texture0. [Vertex] void main(void) { gl_Position = ftransform(); gl_TexCoord[0] = gl_TextureMatrix[0] * gl_Vertex; } [Fragment] uniform sampler2D tex; void main (void) { gl_FragColor= texture2DProj(tex, gl_TexCoord[0]); } glMatrixMode(GL_TEXTURE); glLoadMatrixf(Mr); glMultMatrixf(projection); glMultMatrixf(modelview); // here i got the texture matrix i've setup, right? shader.begin(); // get location and set uniform shader.setUniform1i("tex", 0); glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D, ref_tex); glEnable(GL_TEXTURE_2D); // draw water plane glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0, 0); glVertex3f(-size, 0, -size); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1, 0); glVertex3f(-size, 0, size); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1, 1); glVertex3f( size, 0, size); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0, 1); glVertex3f( size, 0, -size); glEnd(); shader.end(); fixed pipeline(use automatically generated texcoord, the reflected image is right): use shader(the image was distorted): i dunno how this could happen. any help would be appreciated. [Edited by - bybw on December 31, 2004 9:13:34 AM]
15. ## 3d file format using xfrog

Is there anyone using xfrog? www.inf.tu-dresden.de/ST2/cg/downloads/publicplants/ You can see the plants, they just like what in the real world! But I don't know how to import the model(.xfr file) into my project. Who can help me?? cheers, chaz