- Home /
Possible to simulate screen raycast?
I am trying to create a terrain with meshes. The terrain is simply a combination of meshes (like 64 of them). There is a render texture that serves as a heightmap and I sample the heightmap texture to determine vertex y.
How can I know the 3D position of where the mouse pointer intersect the mesh?
Further explanation:
The heightmap texture is maintained and manipulated on the GPU and it may be subject to change in every frame so the solution should run in every frame.
There is no collider for mesh.
It can be assumed that the meshes are in an exclusive layer.
It maybe possible to assume that the meshes are the only objects in the scene (Only acceptable if it can make a tremendous performance advantage)
If we see this as a rendering issue can we just decrease the shader's rendering queue number and hook a method on CPU to sample from the target depth buffer when this particular render queue is drawn and before other draw calls happen and then convert the combination of mouse position and depth to determine 3d position?
Your answer
Follow this Question
Related Questions
Low FPS any ideas ? 1 Answer
Rendering an HD PNG off-screen? 0 Answers
Simulate physics without rendering 2 Answers
Upsidedown depth buffer? (SRP/MRT) 0 Answers
Rendering the same Render Texture differently to separate cameras 0 Answers