Set me in the right direction and fame of mind.

New to shaders. Engineer. I get it. But I need some help understanding the basics of this use case.

I would like to author a shader that draws an object from bottom to top, based on the Y in “view space” but which should not change when the camera changes.

So I changed one of the example shaders to use the view space instead of object space or world space. And I get the result I am looking for. So this (object/world space):


vs This (view space) what I want


But of course, if I move the camera the clipping is going to change.

The effect I am looking for works if the camera has no X rotation.
But with an X rotation it changes as you pan the camera around. And of course if I move the came up and down. But if I have to restrict the camera to no up and down motion that would not be the end of the world. But I do need to have an x angle on it and the X and Z translation.

Can this be done? And can someone theorize on a strategy for it?

Thanks

Just don’t transform the [var] : position passed to the vertex shader and passed it directly to the [var] : position of the fragment input, the rasterizer will put the triangle in place. Though you probably need some rotation and position offset to correctly draws it (especially negative values)

If you need perspective you still has to multiply by the view matrix.

Food for thought. Thank you so much.