depth shading

Pixilang programming language
Post Reply
ainegil
Posts: 168
Joined: Thu Sep 22, 2022 11:37 pm

depth shading

Post by ainegil »

I want to set the color of 3d dots depending on their z position.

However I want to set the 3d position using the t_* transforms before.

It makes no sense to do the math und calculate the resulting z again,
manually so to say,
because then you dont need the t_* operation, and its getting too slow also.

So my question is, if I do

t_transformation
dot3d( x, y, z)
t_reset()

how do I know the resulting z without doing the same
transform with math operators again?
it would be ok to calculate it with an aditional t_ transform on an other container that only contains x,y,z,
but I dont see how thus couod be done.

I workaround I see is to grab the zbuffer after all is drawn and
adjust the colors pixel by pixel, but that needs brute force and is quite slow
and does not work for all use cases.
ainegil
Posts: 168
Joined: Thu Sep 22, 2022 11:37 pm

Re: depth shading

Post by ainegil »

I havent tried it yet but I think t_point() does what I need
ainegil
Posts: 168
Joined: Thu Sep 22, 2022 11:37 pm

Re: depth shading

Post by ainegil »



with compositing and some color processing with gradient in Alight Motion
ainegil
Posts: 168
Joined: Thu Sep 22, 2022 11:37 pm

Re: depth shading

Post by ainegil »

colors have been inverted in Alight

ainegil
Posts: 168
Joined: Thu Sep 22, 2022 11:37 pm

Re: depth shading

Post by ainegil »

with a lighting model similar to Phong shading and an halo effect that is achieved
by strecghing the image, subtracting # FEFEFE, and adding thus to the bext frame



color inversion added afterwards, original is the light on dark scene
Post Reply