PDA

View Full Version : Question about Spot Info's "Spot Size"



jrandom
03-20-2011, 12:24 PM
Does anyone know what the actual output of the Spot Info node's "Spot Size" output is? The manual only says:


"Spot size is the size of the spot currently being evaluated output as a scalar."

... which doesn't actually tell me anything. What does spot size actually represent? The size of a pixel compared to the size of the image? The area in the world that the spot covers at that distance from the camera? In what units is it in? Percentage? Measurement? Argh!

Matt
03-21-2011, 03:39 AM
If you look in the SDK documentation, there is a bit more information:

lwsdk/html/classes/nodes.html

In here Spot Size is referred to as:

"Approximate spot diameter, useful for texture antialiasing. The diameter is only approximate because spots in general aren't circular. On a surface viewed on edge, they're long and thin."

The Spot Size isn't a pixel, it's the 'area' being evaluated for shading.

So technically the description in the manual is correct in saying "Spot size is the size of the spot currently being evaluated".

But what I believe is needed is more information of how this fits into the 'bigger picture' of how shading is evaluated within LightWave.

For that you need to understand how raytracing and all the trappings of that actually work.

If I got it all 100% a diagram showing how all these things relate to each other would be great to do, sadly, I'm not 100% on this!

Lightwolf
03-21-2011, 05:00 AM
The area in the world that the spot covers at that distance from the camera.
Yes.

In what units is it in? Percentage? Measurement? Argh!
Metres, like any other dimensional measurement in LW.

Unfortunately (afaik) it's in world and not local coordinates (which may change it due to scaling) and not really accurate either.

Cheers,
Mike

Matt
03-21-2011, 05:22 AM
(afaik) it's in world and not local coordinates

Spot Size has no coordinates.

Lightwolf
03-21-2011, 05:25 AM
Spot Size has no coordinates.
But the size changes depending on the frame of reference.

Cheers,
Mike

XswampyX
03-21-2011, 11:09 AM
Why don't you render it out?

http://i465.photobucket.com/albums/rr16/xXswampyXx/SpotInfo.jpg

Looks like it's the size of the sample, so the further away and the greater the angle to the camera, the larger the sample size is.

It's a small number.

jrandom
03-21-2011, 11:14 AM
Your render is way prettier than mine. :)

I was able to deduce that spot size is an area, I just wasn't absolutely sure about the scale. Square meters sounds about right.

I am now trying to see if it's possible to come up with a set of descriptor nodes that will allow me to generalize optimizing fractal node detail based on spot size. My initial attempts show this to be a non-trivial exercise, but I've got a few things to try out before I throw in the towel.

Thank you to all who replied. I love this place.

Edit: What are you dividing the height by? Funny, it never occurred to me to use the image dimensions in my calculations.

XswampyX
03-21-2011, 11:19 AM
Yep, If you change your render image size all your gradient colours get screwed up, hence it must be a function of the image size.

jrandom
03-21-2011, 11:24 AM
Yep, If you change your render image size all your gradient colours get screwed up, hence it must be a function of the image size.

Oh! Right! That's to get consistent colors because at higher resolutions your spot size covers less area!

I r smart. I yer ugo i kudnt splel porgramer nouw i r wun.

For fractal textures I wouldn't have to do that -- instead, I need some kind of way to specify the actual size of the small-scale detail so I can combine it with the spot size to smooth it out or reduce bump altitude... and maybe find some way to specify "roughness" so I can blend from bumps to blurry reflections when the spot size gets large enough.

Of course, if it gets sunny again I may just have to go outside for awhile. Haven't done that recently. :)