Page 1 of 2
[req] Distance based fadeoff for textured sss
Posted: Wed Mar 28, 2007 7:43 am
by CTZn
The user will define a distance at wich the texture colors would have fadded out into the medium color (color as absorbtion of course).
The projection is orthogonal to the surface.
- Optionally a
start and
stop distance can be specified; between the surface and the start distance value, sss will have 100% of the texure map colors as absorbtion. Indeed a multiplier (gain?) is needed.
- Very optionally the fadeoff can be configurable as an exponent (2 being quadratic I think, 1 linear).
Posted: Wed Mar 28, 2007 8:37 pm
by mrCarnivore
Could you name a real life example for that effect? Maybe with an image showing it...
Posted: Thu Mar 29, 2007 2:28 am
by zsouthboy
Psst: it's for texturing SSS.
This is actually only a few extra steps beyond what nick is doing to calculate SSS now, if I am guessing correctly.
Posted: Thu Mar 29, 2007 2:52 am
by CTZn
I don't want to argue much, I just had a flash and dropped the idea. I don't pretend to reinvent the wheel, and actually I was the first to defend the idea that using textures to define a volumetric effect is just crap because of the projection eventually used, when the topic was discussed.
The projection is orthogonal to the surface.
There is no projection of material in real life, only light I and diarreha can be projected I guess. But take a reptile skin for instance, if you are not to model every single scale then that would be a good approach I think. Also could do for glassery, like a blend of colored glasses.
Just trying to help bridge the gap... and also I hate maps, they are heavy and finite (wich is a non-sense when you consider the nature of procedurals). 99.99% of the time I use procedurals. But driving procedural attributes by a map is something acceptable for me, like a blend.
Posted: Tue Sep 04, 2007 11:32 pm
by Stur
Posted: Wed Sep 05, 2007 2:33 am
by OnoSendai
This technique is more easily described than implemented.
One tricky question, is, given a point inside the object, how to efficiently find all nearby surfaces that might influence the absorption/scattering coefficients at that point.
Posted: Wed Sep 05, 2007 3:11 am
by Kram1032
O.o uh, yeah, good point.... hum...
Posted: Wed Sep 05, 2007 3:58 am
by CTZn
OnoSendai wrote:One tricky question, is, given a point inside the object, how to efficiently find all nearby surfaces that might influence the absorption/scattering coefficients at that point.
Yes, I see... let's see how lamely I can pseudo-code, really this is an attempt not a demonstration (how would I dare ?). Before all, I'm assuming that Indigo is aware wether a point is inside a volume or not.
Code: Select all
for every point sampled {
Is within a volume ? {
get closest point on the surface describing volume;
measure distance between both //vector is orthogonal to surface
get values at that distance according to ramp, as set by user;
else go on
}
Indigo rules
}
How was that ? Did I miss something important ?
- - - -
Really ?

When was that ? No way, mon ami

Posted: Wed Sep 05, 2007 4:18 am
by OnoSendai
Good start CTZn,
now how to compute
Code: Select all
get closest point on the surface describing volume;
efficiently?
Posted: Wed Sep 05, 2007 4:20 am
by Kram1032
some kind of sincostan function xD
no idea^^
Posted: Wed Sep 05, 2007 4:21 am
by CTZn
hehe, Maya has a node called closestPointOnSurface wich does just that... I think I have a solution, PMing you in a short while...
Posted: Wed Sep 05, 2007 2:32 pm
by oodmb
actualy, thinking about it, an algorithm for computing the closest point on the surface doesnt seem to complicated, assuming that the point in question is known to be inside the mesh and you are searching for the point on the known mesh. first you'd find if the point was inside any of the mesh's tree's spaces, then if it was, check it with each triangle in that space for point and length, assuming that the closest point would be either the distance to the point where the ray (the normal of the triangle and the original point in question) intersects the triangle, or the closest of the triangles verticies to the point. then find all such points and distances like that and within that space, and filter for the shortest one (could actualy be done on the way to this to make things more efficient). if the point is not in any of the mesh's tree's spaces, then compute the closest space in the same manner, and find for the point in that space. all in all, it should actually be a quicker algorithm than intersecting a ray in the whole scene.
although, i still think procedurals are the way to go with this one.
Posted: Wed Sep 05, 2007 3:21 pm
by CTZn
Yummy, procedurals

they come before that very feature we are talking about in my wishlist ! Er... you are talking about procedural textures oodmb, isn't it ? Because after I read your post I wasn't sure I could understand you

(man I should be a coder for 12 years at least!)
Posted: Wed Sep 05, 2007 8:09 pm
by Stur
As I said -->
(which means it was a joke

)
Posted: Wed Sep 05, 2007 9:11 pm
by CTZn
Meet Mr Green !
I like to act like a smartass sometimes, you know, that's a web attitude

and I do have some background in 3d, I'm entitled to have good ideas once in a while even if I'm not the sharpest knife around here, non méééé
Also I hate competition, but when I find myself at a good spot I let ppl know it
You see, I took your last post half seriously but please bear in mind I haven't slept yet, I'm a bit messy... excuse my
cabotinage (ham acting?), dude
