[req] Distance based fadeoff for textured sss

Feature requests, bug reports and related discussion
User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

[req] Distance based fadeoff for textured sss

Post by CTZn » Wed Mar 28, 2007 7:43 am

Image

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).

mrCarnivore
Posts: 517
Joined: Sun Mar 04, 2007 6:20 am
Location: Stuttgart, Germany

Post by mrCarnivore » Wed Mar 28, 2007 8:37 pm

Could you name a real life example for that effect? Maybe with an image showing it...

User avatar
zsouthboy
Posts: 1395
Joined: Fri Oct 13, 2006 5:12 am

Post by zsouthboy » Thu Mar 29, 2007 2:28 am

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.

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Thu Mar 29, 2007 2:52 am

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.

User avatar
Stur
Posts: 594
Joined: Fri Nov 10, 2006 11:52 pm
Location: Nancy, France

Post by Stur » Tue Sep 04, 2007 11:32 pm

Sorry but CoolColJ already suggested that :
http://www.indigorenderer.com/joomla/fo ... 0339#30339



:P

User avatar
OnoSendai
Developer
Posts: 6243
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Sep 05, 2007 2:33 am

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.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Wed Sep 05, 2007 3:11 am

O.o uh, yeah, good point.... hum...

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Wed Sep 05, 2007 3:58 am

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 ?

- - - -
Stur wrote:Sorry but CoolColJ already suggested that :
http://www.indigorenderer.com/joomla/fo ... 0339#30339



:P
Really ? :P When was that ? No way, mon ami ;)
obsolete asset

User avatar
OnoSendai
Developer
Posts: 6243
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Sep 05, 2007 4:18 am

Good start CTZn,
now how to compute

Code: Select all

get closest point on the surface describing volume; 
efficiently?

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Wed Sep 05, 2007 4:20 am

some kind of sincostan function xD

no idea^^

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Wed Sep 05, 2007 4:21 am

hehe, Maya has a node called closestPointOnSurface wich does just that... I think I have a solution, PMing you in a short while...
obsolete asset

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Wed Sep 05, 2007 2:32 pm

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.
a shiny monkey is a happy monkey

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Wed Sep 05, 2007 3:21 pm

Yummy, procedurals :D 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!)
obsolete asset

User avatar
Stur
Posts: 594
Joined: Fri Nov 10, 2006 11:52 pm
Location: Nancy, France

Post by Stur » Wed Sep 05, 2007 8:09 pm

CTZn wrote: >Sorry but CoolColJ already suggested that :
http://www.indigorenderer.com/joomla/fo ... 0339#30339

> :P

Really ? :P When was that ? No way, mon ami ;)

As I said --> :P

(which means it was a joke ;) )

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Wed Sep 05, 2007 9:11 pm

Meet Mr Green !

I like to act like a smartass sometimes, you know, that's a web attitude :roll: 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éééé :D

Also I hate competition, but when I find myself at a good spot I let ppl know it :mrgreen:

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 :?
obsolete asset

Post Reply
21 posts

Who is online

Users browsing this forum: No registered users and 4 guests