Re: How to make a false floor in 3D?
Posted: Thu Dec 19, 2013 12:08 pm
No you cannot. See this image from wikipedia:
You can use a Mesh, you just need to do some trickery in a vertex shader, e.g. using a custom perspective projection matrix and storing the Z-component of the position of the mesh vertices as a texture coordinate or color component (and then making use of it in the vertex shader.)micha wrote:No you cannot. See this image from wikipedia:
Thanks. Good to know.slime wrote:You can use a Mesh, you just need to do some trickery in a vertex shader, e.g. using a custom perspective projection matrix and storing the Z-component of the position of the mesh vertices as a texture coordinate or color component (and then making use of it in the vertex shader.)
Some observations I've made of xXxMoNkEyMaNxXx's (God, that's so hard to type!) textured polygon shader from using it in my 3D project since the beginning: (And I thank him for making it for me)Ref wrote:Is this anywhere near what your want to do?
I have created a front-end loader for xXxMoNkEyMaNxXx shader which makes life a little easier.
Edit: Or maybe something like this- the textured quad. Just a thought.
If someone could create the code required to do this, they'd be heralded as the Hero of Canton. I'd build a statue of them in the town square out of mud. Especially if it didn't rely on the window size (Rather could rely on a custom target width and height if needed) and didn't stop working when setMode is used after it's been loaded. (Also the framerate thing, though not as important with LuaJIT.)slime wrote:You can use a Mesh, you just need to do some trickery in a vertex shader, e.g. using a custom perspective projection matrix and storing the Z-component of the position of the mesh vertices as a texture coordinate or color component (and then making use of it in the vertex shader.)
Someone already has created a small test using this technique (or at least a variant of it), but he hasn't posted it to the forums yet, and I don't think he's called Jayne.Jasoco wrote:If someone could create the code required to do this, they'd be heralded as the Hero of Canton. I'd build a statue of them in the town square out of mud. Especially if it didn't rely on the window size (Rather could rely on a custom target width and height if needed) and didn't stop working when setMode is used after it's been loaded. (Also the framerate thing, though not as important with LuaJIT.)
I really would like to know where to find thatslime wrote:Someone already has created a small test using this technique (or at least a variant of it), but he hasn't posted it to the forums yet, and I don't think he's called Jayne.Jasoco wrote:If someone could create the code required to do this, they'd be heralded as the Hero of Canton. I'd build a statue of them in the town square out of mud. Especially if it didn't rely on the window size (Rather could rely on a custom target width and height if needed) and didn't stop working when setMode is used after it's been loaded. (Also the framerate thing, though not as important with LuaJIT.)
1. You ran setMode after loading the library? Because if you only setMode before loading the library (require 'Perspective') then it works fine until you try to change the window mode again. Are you on 0.8.0 or 0.9.0? Because it has failed for me on both.Ref wrote:Jasoco made some interesting observations regarding xXxMoNkEyMaNxXx's shader.
1. I haven't experienced his problem with setMode. Just ran a test and everything kept running???
2. Speed hit is related to area over which the shader is operating - obviously. Simple solution is to use (caution, dirty word coming) a canvas. A canvas solves both the frame rate drop and control over operational area of the shader.