Jump to content

proper height map in a shader


anupamd

Recommended Posts

I cant believe Im having issues with this simple shader:

Trying to get a height map (well its actually a z-depth map) that has a very narrow range.

For example my furthest point is -2 on z and the nearest point is +2 on z. I want to generate a greyscale map that has a value from 0 to 1.

The math Im using is just pz-farplane. in this example our values will range from 0 where z is the farthest point and 4 where the point is at the near plane.

if I use a fitrange and remap the values 0->4 to 0->1 i should get a nice smooth ramp. But that is not working.

Is there a better way to do this or a shader that already exists? Thanks,

Link to comment
Share on other sites

bump.. anyone? its just a simple heightmap for crying out loud. I tried some other things, nothing is working.. the only thing that does work is embedding height via bounding box ($BBZ) as point color. This .. is not satisfactory. I need it to work in a shader so I can bake depth from displacements..etc.

I cant believe Im having issues with this simple shader:

Trying to get a height map (well its actually a z-depth map) that has a very narrow range.

For example my furthest point is -2 on z and the nearest point is +2 on z. I want to generate a greyscale map that has a value from 0 to 1.

The math Im using is just pz-farplane. in this example our values will range from 0 where z is the farthest point and 4 where the point is at the near plane.

if I use a fitrange and remap the values 0->4 to 0->1 i should get a nice smooth ramp. But that is not working.

Is there a better way to do this or a shader that already exists? Thanks,

Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...

Hi guys.

I am struggling on how to get a height map (black and white texture) to work on a grid.

I add a vopsop, and in here I usually use a turbnoise and connect it to displacement.

Now I am trying to use a texturenode to displace the grid, but I can´t get it to work.

Here is a simple setup that I tried to do. Can´t find where I should look in the help neither...

Does anybody have some ideas?

Thanks,

Anders

texture_to_heightfield_on_grid.hipnc.hip

Edited by dynamoanders
Link to comment
Share on other sites

Could you not just render a ramp using the object bounds on whatever axis you wanted that way getting a full range from 0-1 without having to worry about remapping to an objects specific. You could do it in a vop or simply uv project and texture with a ramp. I have rendered a lot of height maps for both terrain and parallax mapping this way

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...