Reply To: Switch texture water to lava

Home Forums AR Sandbox Forum Switch texture water to lava Reply To: Switch texture water to lava

#2444
Sean Robinson
Participant

I think the “water” (in lava mode) you are calling a “shader” is part of the “color map” in the sandbox software, it describes the sand elevation using different colors. The default color map is blue below sea level and a rainbow of colors above sea level.

You can tell the running sandbox to use a new color map file:

1) If not already done, add a control pipe in the folder you launch SARndbox. In a terminal window, run mknod SARndbox.pipe p to create a pipe you will use to control the running sandbox.

2) If not already done, tell SARndbox to use a control pipe. This is done with the -cp SARndbox.pipe option. I.e. “SARndbox -uhm” becomes “SARndbox -uhm -cp SARndbox.pipe”. The pipe names must match in steps 1 and 2.

3) Create an alternate color map file. Find “HeightColorMap.cpt” and copy it, in the same folder, to “HeightColorMap-lava.cpt”. The four columns in cpt files are (left to right) elevation, red, green, and blue. Edit “HeightColorMap-lava.cpt” to swap the red and blue values for all elevations below sea level. For example, the first line (“-40.0 0 0 80”) becomes “-40.0 80 0 0”.

4) Test your new color map in a terminal window. Run echo "colorMap HeightColorMap-lava.cpt" > SARndbox.fifo to change to the lava color map. Run echo "colorMap HeightColorMap.cpt" > SARndbox.fifo to change to the default color map.

5) Add echo "colorMap <color map file>" > SARndbox.fifo to the “switch” scripts to match the color map to the texture.

6) Ask questions if you run into problems.