shadmar Posted April 9, 2013 Share Posted April 9, 2013 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 : HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted April 9, 2013 Author Share Posted April 9, 2013 Published lua test project : https://dl.dropbox.c...319604/lua1.exe HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted April 11, 2013 Share Posted April 11, 2013 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 More sharing options...
shadmar Posted April 14, 2013 Author Share Posted April 14, 2013 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 More sharing options...
Josh Posted April 15, 2013 Share Posted April 15, 2013 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 More sharing options...
shadmar Posted April 15, 2013 Author Share Posted April 15, 2013 I guess, but I don't know how to work around that. The texture coordinates are just : vec2(gl_FragCoord.x/buffersize.x, -gl_FragCoord.y/buffersize.y) HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted April 15, 2013 Share Posted April 15, 2013 Try this: vec2(gl_FragCoord.x/buffersize.x, 1.0-gl_FragCoord.y/buffersize.y) 1 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 More sharing options...
shadmar Posted April 15, 2013 Author Share Posted April 15, 2013 Would you look at that... I'm sure that was the only combo I didn't try.. Thanks Josh 1 HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Recommended Posts