Hey, I am trying to implement raymarching into a heightmap in a shader to display a volume of this heightmap. I was thinking to create a cube to raymarch into and then check whether or not the current position of the ray has hit the height specified by the given heightmap. To this end, I thought of applying the heightmap to one face of the cube only, such that the x,y plane corresponds to the uv space of the texture and the height (z dimension) is given by the texture values of the height map. When I then march along the rays through each pixel, I would like to transform the ray as specified in world space coordinates into this 3D space of uv coordinates + height.
Since I am new to shader programming I am not quite sure how to achieve this though
Any help would be greatly appreciated!
↧