How to shade based upon heigth?

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

How to shade based upon heigth? // New Users

1  |  

Post by yupnow // Aug 27, 2008, 5:06am

yupnow
Total Posts: 1
I have a CAM machine that uses a JPG drawing file as it's input. It uses the shade of gray of each pixel to set the depth of a cut at that location IE white = zero depth and black = a .8 inch depth cut. I would like to model a project in Truespace and then have it automatically color the 'skin' of the drawing with shades of gray. The shade of gray for each pixel to be based on the height, or z axis, of the skin at that location. Perhaps white for the highest part of the drawing and down to black, in 100 steps, for the ground level locations. Note that this coloring has nothing to do with the object lighting, only the Z axis height. I've attached a sample of a star to show what kind of drawing I need to produce. Black is lowest part and white is the highest.


Is Truespace 7.6 capable of doing such automatic depth shading? If so, is there a tutorial somewhere or could someone please provide the steps to produce such a drawing?


Thank you,

John

Post by TomG // Aug 27, 2008, 5:58am

TomG
Total Posts: 3397
Should be possible with shaderlab, some shaders that might help


http://www.tmgcgart.com/ShaderLab/html/tg_pack_1.htm#particles2

(just ignore the noise and make it vary by z)


Some of the distance shaders:

http://www.tmgcgart.com/ShaderLab/html/tg_pack_3.htm#MaskDistanceShaders

(may be able to render from directly above, thus making distance related to height)


In the free department there is a distance shader or even fog:

http://www.tmgcgart.com/ShaderLab/html/shader_listing_2.htm#DistanceTransparency



The free shaders also should have visible code, so you could just quickly modify one to be more what you need. I did have something with surf on water that was based on height, so one of those shaders in there somewhere was able to do that sort of thing!



EDIT - and of course such a thing should be possible to write with the DX shaders in tS7.6 workspace view. The shaderlab ones would be Lightworks only.


HTH!

Tom

Post by stan // Aug 27, 2008, 10:35am

stan
Total Posts: 1240
pic
there are others here that should work on model side with lightworks..:)
http://www.digivision.com.tw/truespace/tsplugin/index.htm
PIaazbuffertool on page1
ZRender on page2
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn