anupamd Posted November 4, 2011 Share Posted November 4, 2011 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, Quote Link to comment Share on other sites More sharing options...
anupamd Posted November 5, 2011 Author Share Posted November 5, 2011 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, Quote Link to comment Share on other sites More sharing options...
sam.h Posted November 5, 2011 Share Posted November 5, 2011 Could you post a scene that works (the one with $BBZ). I having trouble understanding what you need .... Quote Link to comment Share on other sites More sharing options...
nord3d Posted December 16, 2011 Share Posted December 16, 2011 (edited) I need it to work in a shader so I can bake depth from displacements..etc. I think, I understand. Maybe something like this: Edited December 16, 2011 by nord3d Quote Link to comment Share on other sites More sharing options...
dynamoanders Posted November 14, 2012 Share Posted November 14, 2012 (edited) 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 November 14, 2012 by dynamoanders Quote Link to comment Share on other sites More sharing options...
dynamoanders Posted November 15, 2012 Share Posted November 15, 2012 Here is an old solutions that worked for me. http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=93656&sid=b4a5605ea1e90a11881359baffff8fe2 Quote Link to comment Share on other sites More sharing options...
sl0throp Posted November 23, 2012 Share Posted November 23, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.