Jump to content

depth and buffers and DepthToZPosition


Recommended Posts

Not sure what is broke, but my previously working water has issues with depth or depthtozposition.

Seems like it's not correctly computed or maybe camerarange contains nils?, have no idea what to look for.

 

I use this :

float DepthToZPosition(in float depth) {

return camerarange.x / (camerarange.y - depth * (camerarange.y - camerarange.x)) * camerarange.y;

}

 

This is what it looks like now :

 

depth.jpg

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Is this an installer or a packed EXE? I can't see the Lua code if it's all packaged up in one EXE.

 

In the Buffer::Create() function you need to specify 1 color buffer, and 1 to include a depth buffer.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It's the installer exe that LE creates when I click publish.

 

 

self.buffer = Buffer:Create(1024,768,1,1)

The color and depth buffers are created, but I can't d depth to z position correctly anymore after latest update. (it was working before last update in cpp) now I can't seem to do it in either cpp or lua.

 

How to compute accurate screencoords after latest update?

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Although buffers are not officially in the API yet...one thing that changed recently is the depth component is being clamped now. So if your texture coordinates are outside the range of 0-1, they will get clamped to the edges. I bet that is causing it.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...