Jump to content


Help with PDF


13 replies to this topic

#1 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 08 October 2009 - 11:48 AM

http://graphics.ucsd...fast_bssrdf.pdf

Im having a difficult time with sss, I cant quite seem to understand how it works... could anyone give me a few hints? (especially ReedBeta, pleeze read this!)
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#2 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 08 October 2009 - 04:23 PM

http://ki-h.com/arch...iH-PG07-SSS.pdf

Heres the real time equivilent, ive looked at its shots and it is VERY realistic for skin, I recommend everyone having a look at this one, its excellent.

But the maths is just a little too hard for me... what I really would ask santa for is a working exe of this algorythm so I can have a look at it in code.

Converting those equations to code I cant say im good enough at maths to do. But this is really worth a bit of effort in putting together, itll make your game look partially offline rendered!
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#3 poita

    Senior Member

  • Members
  • PipPipPipPip
  • 322 posts

Posted 09 October 2009 - 01:47 PM

What maths don't you understand?

Do you know what derivatives and integrals are? Any vector calculus?

I've never actually done any of that SSS stuff, but I understand the math.

#4 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 09 October 2009 - 03:47 PM

Since we both live in perth, you could come round and tutor some calculus to me, id be a good student! :)
Im sorry, im good with programming systems, but im a total flunk at maths... dont say math thats what americans say, we are australian we say maths like english people...

You wouldnt believe this, but I can code the DFT (discrete fourier transform) but I cant read the notation for it for nuts!!

Really, I just need a good example in CODE! then id be able to reverse engineer it.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#5 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 10 October 2009 - 12:35 AM

That second paper you posted is unfortunately very terse and vague (conference papers are often so, because many of the big conferences have a limit of 4 pages per paper, which is hardly enough to say anything...). I gave it a read-through, but I still have no idea what they're actually doing. :D Maybe checking out some of their references will help give the necessary context. It also looks like the authors are working on an article to appear in ShaderX7, which will hopefully contain more details.

As for the math part, I'd recommend picking up a copy of Pharr and Humphreys, as it will give you a decent introduction to the kind of stuff you see in these papers (you will, however, need to already have a handle on integrals).
reedbeta.com - developer blog, OpenGL demos, and other projects

#6 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 10 October 2009 - 04:47 PM

Thanks for having a look.
So you dont think im a total dumbass for not understanding then...
Im definitely getting shader x7, cause it might come with some slappinable code especially, and I might get that p&h book you mentioned, because itll probably get me thinking more standardly about things.

Thankyou for your time.

<EDIT> Integrals? Doesnt sound easy. I got my brother to have a look and he said it was "double integration" whatever that means because he went through maths at uni. But even he cant help he says its too hard. </EDIT>
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#7 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 10 October 2009 - 06:14 PM

The formalism isn't that bad once you get used to it. An integral basically computes the average value of a function over all the points in some region. So, for instance, you'll often see an equation saying that outgoing radiance is the integral over the hemisphere of the BRDF multiplied by the incoming radiance. It just means that to get the color of a surface you add up all the light sources multiplied by your lighting equation (like N.L, or N.L + N.H, or whatever). So you rarely need to actually solve the integrals in the usual calculus sense - you're just going to approximate them by a sum most of the time. It's still handy to realize how all the usual computer graphics formulas are various ways of approximating the same underlying integrals.
reedbeta.com - developer blog, OpenGL demos, and other projects

#8 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 10 October 2009 - 09:15 PM

I can + and - yeh, but you how they make things SO HARD TO LOOK AT!
Id be bringing out the easy lecture as soon as I do it, and ill mention how im actually looking for a dry surface not a wet surface, in real time.

I gathered points around a spherical area around every pixel, BUT IT DIDNT WORK! It ONLY LOOKED LIKE RUBBER!

I was thinking there was a way to use proper balancing equations to bring it to real marble quality.

But thanks, I understand what you say, just not what they say.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#9 poita

    Senior Member

  • Members
  • PipPipPipPip
  • 322 posts

Posted 11 October 2009 - 04:48 AM

If it helps, you can think of an integral as something like this:

double integrate((f*)(double), double from, double to)
{
  double sum = 0.0;
  const double step = 0.001;
  for (double x = from; x < to; from += step)
    sum += f(x) * step;
  return step;
}

The only difference is that the mathematical integral assumes that "step" is infinitely small, making the calculation infinitely accurate.

#10 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 11 October 2009 - 04:23 PM

So each instance of the function gets multiplied by a really small value (the amount your stepping along the 1d line) and the function is computed alot of times, making it cpu intensive.

Is double integration 2d integration?

http://www-evasion.i...07/sap_0327.pdf

Ive found an even simpler explained paper, but I think its missing equations, I almost understand tho...
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#11 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 11 October 2009 - 05:16 PM

rouncer said:

Is double integration 2d integration?

Yep. However, most of the integrals in those papers are actually even worse. For instance in the Ki paper in equation 1, the two integrals are over an area around the point and over the hemisphere, respectively. Each of those is a 2D integral in itself, so the whole thing is actually a 4D integral.
reedbeta.com - developer blog, OpenGL demos, and other projects

#12 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2758 posts

Posted 11 October 2009 - 05:41 PM

Im sure when it gets to code and put into ordinary c iterators, id have a lot better chance at understanding. :) But I know I got to learn notation... I feel like an idiot.
Ive always done my maths with simple code and variables, I even write * for multiplication when I do my simple algebra I need from time to time on a piece of paper on the dining room table...
I remember I was looking up wavesurfing voxel terrains and I got some of maths written by the lecturer in C! cool! So it slaps straight in, I much prefer teachers that do the conversion for you!

But I have been torturing myself with equations these past few days but I think im getting a little better at it.

I bet "4d integration" could make it into code a lot of different ways... am I right?
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#13 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 11 October 2009 - 05:54 PM

Yeah, definitely a lot of different ways...as you're finding out while researching SSS! :D All of the techniques out there are different ways of approximating that same integral.
reedbeta.com - developer blog, OpenGL demos, and other projects

#14 poita

    Senior Member

  • Members
  • PipPipPipPip
  • 322 posts

Posted 12 October 2009 - 12:31 AM

rouncer said:

So each instance of the function gets multiplied by a really small value (the amount your stepping along the 1d line) and the function is computed alot of times, making it cpu intensive.

Yeah, basically, although as ReedBeta says, you'll never actually do the integration like that in real time as it's far too expensive. You have to find approximations.

And that's where the maths comes in. You can make integration a lot simpler to computer if you can find the antiderivative. For example:

if f(x) = 2.0 * x

then the antiderivative is F(x) = x * x

and then you can calculate the integral more easily (and more accurately):

integrate(f, from, to) == F(to) - F(from)

This is called the second fundamental theorem of calculus.

Unfortunately, finding the antiderivative is difficult in many cases, so you have to use approximations.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users