Sign in to follow this  
Pryme8

Billboard RayMarch Plane

Recommended Posts

I basically want to take a plane that always faces the camera if its in its frustum, and raymarch a object on it like lets say a tree.  Then be able to move around in the scene and keep the raymarched object in the middle of the plane but update the position of the camera on the shader so you can view it from all angles.

Im thinking it might just be smarter to use a square.

Share this post


Link to post
Share on other sites

https://www.babylonjs-playground.com/#ZFUV4U#12

Looks like I just need help with the "lookAt" Math.   I need some sort of calculation that will make it so its not like looking through a window, but at an object and so the axis arrows stay in the center of the plane no matter what your view angle is.
https://www.babylonjs-playground.com/#ZFUV4U#14 <- for anyone who wants to just move around the raymarched scene.  The camera controls are attached to it.

https://www.babylonjs-playground.com/#ZFUV4U#18 <- Basic Planet/Moon

Share this post


Link to post
Share on other sites

I need some math help...
someone please give me an idea here...
 

So let me re-explain. We have a plane that is billboarded and on that plane is a shader that is rayMarching another scene or object.  If we move the camera around in the scene and look at the raymarch plane it is like your looking through a window (kinda).

What I am trying to do is figure out the projection math behind keeping an object centered in the rayMarched scene but still keep the ability to move the camera around it.  So effectively I could make the plane look like a cube that you can walk around, but is only really two polygons with a shader on it.

Im thinking I need to get a reflect angle and get the difference between the cameras target and the output plane then apply the inverse to the rayMarch camera matrix? 

https://www.babylonjs-playground.com/#ZFUV4U#22
^^^ Ive kinda got it, but there seems to be a "wiggle" or like some sort of parallax effect on the position of the rayMarched Object.

NEEED INPUT!!! JOHNNY 5 NEEDS INPUT!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.