lpm_jacky

Members
  • Content count

    33
  • Joined

  • Last visited

Community Reputation

103 Neutral

About lpm_jacky

  • Rank
    Member
  1. A Simple and Practical Approach to SSAO

    Do the position and normal buffers are in model view projection (mvp) space. For example, I have a world space position p_world and world space normal of a pixel. I need to convert them to mvp space by p_mvp = mul(mvp, p_world); p_mvp/=p_mvp.w; and n_mvp = mul(mvp, n_world) n_mvp/=mpv.w; Does anyone help me since I can't exactly produce the SSAO effect mentioned in above.
  2. Questions/problems on SSAO's steps

    Hi all, Finally I give up implementing "Hardware Accelerated Ambient Occlusion Techniques on GPUs". Then, I shift the implementation to "A Simple and Practical Approach to SSAO" written by José María Ménde. The result seems as my expectation. Here is the rendered result! Jacky [attachment=1187:screen0001.png]
  3. Hi all, I am currently implementing SSAO of the paper P. Shanmugam and O. Arikan, "Hardware Accelerated Ambient Occlusion Techniques on GPUs," in Proceedings of the 2007 symposium on Interactive 3D graphics and game, 2007. I followed the steps mentioned in the paper as 1. create ND-buffer: this buffer is a 2D texture in screen space. Every pixel in the buffer stores a normal and a 3D position. They are in world coordinates. Denote this ND-buffer as NDbuf 2. create a texture which contains random texture coordinate offset values. These values depend on r_far. Denote this texture as Randbuf. 3. For a particular pixel, p, in screen, assume the pixel p has screen coordinates tc.x and tc.y. It reads its normal and 3Dposition from NDbuf in fragment shader according to tc.x an tc.y. 4. Set a number of neighbor pixels, n_sample. 5. Locate the neighbor pixels by adding offset values from Randbuf, ie. tcOffset.x and tcOffset.y. 6. For each neighbor pixel neighbor_p, read its 3Dposition from NDbuf using the coordinates (tc.x+tcOffset.x) and (tc.y+tcOffset.y). 7. use p.normal, p.3Dposition and neighbor_p.3Dposition to calculate an approximate ambient occlusion, AO_i. The calculation is based on eqaution (2) of the paper. 8. sum all the AO_i's (based on equation (4) of the paper) and get the average approximate ambient occlusion AO. However, the rendering results are not as expected (please see the attached image). Does anyone know what I did wrong in the SSAO approach? Or, does anyone know where can I find more information/example about SSAO approach. Thanks. Jacky [attachment=1179:screen0000.png]
  4. Shadow Map problem

    By the way, any approaches that can improve the quality of shadow map when the lighting is at small grazing angle of a surface element? Or any approaches which could relieve the precision problem of depth map for shadow mapping?
  5. Shadow Map problem

    Candy, yeah! [attachment=1113:shadowmapproblemsolved.png]
  6. Shadow Map problem

    Thanks. I got your points and the rendering results are better. By the way, it would have problem when the object is an planner object with small grazing angle. To relieve this problem, N dot L could be used. Jacky
  7. Shadow Map problem

    I am wondering the precision of depth map generated in light space. It seems to me that the precision is far below single precision. I am currently using NVidia GTX470 and I don't know whether this card needs to enable something explicitly in order to use single precision calculation (I know its non-sense). Does anyone have another ideas since I have tried to use a number of bias values to improve the rendering quality, but doesn't help so much.
  8. Hi all, I have a problem in traditional shadow map rendering. The only difference that I did is I use shader to perform shadow mapping. However, the rendering result is not good. Does anyone know what's happen? And how to solve it? Jacky [attachment=1104:shadowmapproblem.png]
  9. Hi all, I would like to know does OpenGL support double precision texture input for shader to perform double precision operation?
  10. Hi, ic your point. But, how I know which other vertex buffers are bound to the shader since I have more than one other vertex buffers exists in my program. In addition, I am tackling with DX9. Manay thanks.
  11. Hi, does anyone know the cause of this problem in XBOX: ERR[D3D]: The current vertex shader was bound to a vertex declaration that is not the currently set vertex declaration. Thanks.
  12. Hi, I am using D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY for creating a vertex buffer in PC to multi-write vertex data to this dedicated memory. It works fine for PC platform. However, when the platform is switched to XNA (XBOX) platform, it does not have any D3DUSAGE_DYNAMIC feature. For simplicity in testing, I just omit D3DUSAGE_DYNAMIC and uses D3DUSAGE_WRITEONLY for creating the vertex buffer. It crashes when reaching to "DrawPrimitive" command in this case. It seems that no D3DUSAGE_DYNAMIC crashes my rendering engine. Does anyone know is there any feature that I can use in XBOX platform to perform the same feature of vertex buffer (multi-write). Could anyone please tell me the right reason if the crash doesn't relate to no D3DUSAGE_DYNAMIC. Thanks
  13. Hi, Are there any difference between two different methods for setting texture in D3D9? LPDIRECT3DBASETEXTURE9 Tex; case 1, LPDIRECT3DDEVICE9 g_Device; g_Device->SetTexture(0, Tex); case 2, M2Effect *xxxxEffect; //obtain effect from xxxxEffect LPD3DXEFFECT effect; Param_Tex = effect->GetParameterByName(NULL, "g_Tex"); effect->SetTexture(Param_Tex , Tex);
  14. That mean I need to create a rendertarget and do it by myself. Am I right?