Jump to content

  • Log In with Google      Sign In   
  • Create Account

sienaiwun

Member Since 27 Feb 2012
Offline Last Active Dec 20 2013 10:29 AM

Topics I've Started

depth layer number

22 November 2013 - 02:37 AM

 Hi.

   I meet a question: when do depth peeling, how could you know the depth layer number? 

   In other words, during rendering, many fragments happens in one pixel, but one remains to be the final color due to depth test. How could you know the number of fragments? 

  obvioursly, render times and times again to get a more "deeper" image and finaly see if there are any shading pixel is one way. But the question remains: how do you know the render times? 


How to bind a 3d noise volume

16 November 2013 - 10:17 AM

Like http://www.gamedev.net/topic/588982-3d-noise-texture/

I have a dds file, a 3d noise volume, 128 slices. But I donot know how to bind a texture 3d. 

For googled information, the most common one used is that dds file is a compresed 2d image . and then bind a GL_TEXTURE_2D texture.  like http://stackoverflow.com/questions/1715027/dds-dxt1-loading-in-opengl-crashes I don't want this answer.

Can anyone give me a hand?


SdkMesh conventer

09 September 2013 - 03:11 AM

 Hi:

   I want to convert a .sdkmesh file to other mesh file like .obj file .x file or 3ds file. However, I cannot find a way. 

   The meshConverter.exe in direct sdk can only load .x file and convert .x file to sdkmesh file, althought it says it can read sdkmessh file. I have read the source code of that example. The loader there can only read .x file. So meshConverter.exe is not a solution.

   Can anybody give a hand? 

   Thanks in advance.


24 bits texture fetch in shader

20 June 2013 - 09:28 AM

Hi,
I want to get depth value from the depth texture and the depth texture is init as this:

------------------------------------------------------------

glGenTextures(1,&pass2_depthImage);
glBindTexture(GL_TEXTURE_2D, depthImage);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 1024, 1024, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
------------------------------------------------------------
I wonder how to get the depth value fom this image in a shader, I use this:
   float3 sampleZ = tex2D(depthMap, projCoord.xy).xyz;
   float3  bitShifts = float3(1.0/(256.0*256.0), 1.0/256.0, 1); 
   float depth = dot(sampleZ,bitShifts);
in the idea that the 24bit depth value is in 24 scale. However, it does not work, as it may use a 24 bit float value or something.
 
I also wonder as I init the texture as this:
glGenTextures(1,&pass2_depthImage);
glBindTexture(GL_TEXTURE_2D, depthImage);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 1024, 1024, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
 
I get the depth as this:
   float depth =tex2D(depthMap, projCoord.xy).x;
It still not works.
And every RGB channel values is as the same as I init the depth texture map internal format as GL_DEPTH_COMPONENT24.
 
The depth image rendering:
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, pass2_depthImage, 0);
 
 

 


Compute project triangle's area

12 May 2013 - 10:17 PM

Hi.

  I want to compute several triangle models' projective area on the view plane. My current method is that I write a soft-ware rasterizer and do the rectangle culling of triangle pixels out of the view rectangle and then computer the area.

 As there is no hard-ware culling, it's time consuming. I wonder is there any idea of another way of triangle culling.

 For example, can the triangles be parameterized into a vector, and do a 2D vector culling? Is there any paper about it?

 Or as the area could be coarse, is there any better parameter way?

Sincere.


PARTNERS