PDA

View Full Version : ...a "light" that changes surface color only. (no light)



erikals
10-03-2009, 03:23 PM
wondering,

is it possible to make a light that changes surface colors only, without sending out any light?

jameswillmott
10-03-2009, 03:32 PM
Sort of, you could use a node network to trace rays at a light and if they reach it change the resulting colour...

OnlineRender
10-03-2009, 03:49 PM
good question ! stop me if I'm talking mince , could you not set up a spotlight for example , make a transparent coloured poly and stick it infront of the light and mess about with settings ?edit still sends out light hmm volumtrics

erikals
10-03-2009, 03:58 PM
OnlineRender, i don't think that would work... i think it's still send out light...

jameswillmott, um, not sure i get it, so i would have to apply this effect to each single surface then?

using a pointlight would be ideal in my case.
i'm trying to go for a radiosity fake, if i can get this to work,..

edit: i can do it in post i guess, if i make some alphas and stuff...

jameswillmott
10-03-2009, 04:45 PM
jameswillmott, um, not sure i get it, so i would have to apply this effect to each single surface then?

edit: i can do it in post i guess, if i make some alphas and stuff...

Yes, but post might be simpler.

Sensei
10-03-2009, 04:46 PM
is it possible to make a light that changes surface colors only, without sending out any light?

In normal case where Intensity is less or equal 100%, and without GI, light item is not sending light, but darkening raw surface color.

Between light's sample direction and surface's normal vector there is done dot product calculation (dot product is x0*x1+y0*y1+z0*z1, and because they're normalized, it's basically cosine between two vectors - you can use arccos to get angle in radians or degree). f.e. simple distant light have light sample direction always constant, not disturbed by position or size of light item. Sum of all dot products of all light samples is multiplied by surface raw color. That cosine is always between -1.0 and 1.0. But all above 0.0 are rejected and negative values are only used.

f.e. distant light has position 0,1,0 and is rotated to down, will have sample direction 0,-1,0.
Plain ground surface is at position 0,0,0 and normal vector is 0,1,0 pointing to up.
dot product of sample direction and normal vector will be 0*0+(-1*1)+0*0=-1, inverse of that is 1
So 1*raw red,1*raw green,1*raw blue=raw rgb. Exactly the same color.
Rotating light item will change light sample direction, to something like <1.0,<1.0,<1.0, so after another dot product you will be always getting value that's smaller than raw color in the all channels. You cannot get color that's higher values.

Answering your question- no, I don't think so, that you can set any surface color to your needs. It would be quite limited. You could set surface color to only such that has smaller RGB, than original color. And as long as Render Globals > Ray-Trace Shadows, is off (light sample direction will be used to trace any elements between surface spot and scene geometry to find out whether there is collision, which means that surface is in shadow).

(if you were asking about making custom light type plug-in)

Sensei
10-03-2009, 04:52 PM
Sort of, you could use a node network to trace rays at a light and if they reach it change the resulting colour...

Ray-casting from Spot Info > World Spot Position, in direction Item Info > World Position - Spot Info > World Spot Position, then normalized, then accepting anything smaller than length of above vector and rejecting -1, will mimics only point light type.

Lightwolf
10-03-2009, 05:19 PM
How about using the single light illumination node from the db&w tools to drive the opacity of a colour mixer, or anything else?

You can exclude the item from the light in the item properties, the node will still work.

Cheers,
Mike

erikals
10-03-2009, 05:39 PM
i think i understand, however that would have to be applied to each surface? so i'm trying to find better ways around it.

another question here, is it possible to drive say, a spotlights intensity based on how much light it receives.
E.g. placed in the shadow, it would send out less light, placed in the light it would send out more light.
is this possible?

erikals
10-03-2009, 05:43 PM
hmm, maybe this Jeremy Hardin script is on to something...
http://jeremy.lwidof.net/lscript/shadow_lights.jpg
http://jezza.lwidof.net/lscript/#shadow_lights

erikals
10-03-2009, 06:51 PM
aureka! :)

cached -fake bounce
(also attached; cached -no bounce)

rendertime, cached -fake bounce, 2seconds on a Quad 2.4GHz
(fake motion blur, After Effects Revision plugin motion blur)


in case anyone wonders, i also used the radiosity trick posted over here,...
http://www.newtek.com/forums/showthread.php?p=932305#post932305

(you will need to install the plugin from Jeremy...)
http://jezza.lwidof.net/lscript/#shadow_lights

erikals
10-03-2009, 07:46 PM
also found this...
http://www.newtek.com/forums/showthread.php?t=99571

erikals
10-03-2009, 08:55 PM
hm, also interesting,...
http://www.newtek.com/forums/showpost.php?p=907687&postcount=19

ok, this looks more like what i had in mind...
http://www.newtek.com/forums/showthread.php?t=57958&highlight=ColorBleed+Node&page=2


edit: umf, doesn't look to work with radiosity...

ericsmith
10-04-2009, 09:30 AM
A quick and easy setup that does what your original question asks would be this:

Create a light that illuminates the color you're looking for

Clone the light, and set it's color to white

Set the intensity of the cloned white light to the the same value as the original but negative (so if the first light was 65%, the second would be -65%).

In reality, I think the negative light will subtract a tiny bit more light than the positive colored one, because the color reduces luminosity. So you might want to cheat a bit and reduce the negative value by a few percent or something. But overall, it seems to accomplish what you're looking for.

Eric

Sensei
10-04-2009, 11:40 AM
Are you sure Eric? Using your description I am only getting black render.. Maybe you missed some important step?
From math point of view it's not surprise that render is black (or even negative in floating point RGBA format), because:
raw surface color * light color * dot product * intensity + raw surface color * white * dot product * ( -intensity ), will be giving 0.0 for light color=white, and always negative RGB for anything else than white.

EDIT: trick started working after adding any 3rd light, that normally illuminates. That looks very nice!

OnlineRender
10-05-2009, 03:04 AM
hmm, maybe this Jeremy Hardin script is on to something...
http://jeremy.lwidof.net/lscript/shadow_lights.jpg
http://jezza.lwidof.net/lscript/#shadow_lights

cheers for the linkage - sensie your website is excellent aswell some nice pluggins . . . I dont suppose you know of a pluggin that rotates the camera 360 will staying focused on the objects centre ??????? I suppose you could model a circle then snap the camera to path ?

erikals
10-05-2009, 03:11 AM
...a simple trick is not moving the cam at all, but rotating the object(s) instead.

OnlineRender
10-05-2009, 03:57 AM
...a simple trick is not moving the cam at all, but rotating the object(s) instead.

Iv'e done that before "select the whole scene and spin it " I understand what you mean , but there's certain elements I need to stay the same .plus the camera is at an angle raised slightly above the obj . .think bulet time

dee
10-05-2009, 05:23 AM
Put a null at the rotation center, parent camera to it, rotate the null.

OnlineRender
10-05-2009, 06:42 AM
Put a null at the rotation center, parent camera to it, rotate the null.

easy LOL

Sensei
10-05-2009, 07:04 AM
cheers for the linkage - sensie your website is excellent aswell some nice pluggins . . . I dont suppose you know of a pluggin that rotates the camera 360 will staying focused on the objects centre ??????? I suppose you could model a circle then snap the camera to path ?

If such plug-in exist, you need to search for Motion Modifier.
Maybe CurveConstrain? I have not tried that though..

OnlineRender
10-05-2009, 07:07 AM
If such plug-in exist, you need to search for Motion Modifier.
Maybe CurveConstrain? I have not tried that though..

Sensei , I like your pluggins page , some nice add-ons

erikals
10-05-2009, 09:29 AM
Put a null at the rotation center, parent camera to it, rotate the null.

bah!! http://forums.cgsociety.org/images/smilies/grin.gif even better..!! http://forums.cgsociety.org/images/smilies/wink.gif

jaxtone
10-06-2009, 01:52 AM
Maybe a little twist and tweak with this could do the job?

http://www.happy-digital.com/cowstic.asp