Planetside Software Forums

General => Terragen Discussion => Topic started by: gregsandor on June 19, 2008, 07:32:23 AM

Title: How do I set a light to only cast spec?
Post by: gregsandor on June 19, 2008, 07:32:23 AM
How do I set a light to only cast spec?  No illumination, no shadow: I just want to hit a specular reflection on the dark side?
Title: Re: How do I set a light to only cast spec?
Post by: JimB on June 19, 2008, 07:38:47 AM
Make all shaders completely black and comp a render of that (should be only pure specularity showing) on top of a full render.

The only way I can think of, but maybe someone knows better.
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 19, 2008, 07:41:56 AM
Thanks, Jim.  Any ideas that will keep this to one pass?
Title: Re: How do I set a light to only cast spec?
Post by: Tangled-Universe on June 19, 2008, 09:51:21 AM
So if I understand correctly you want some specularity on a dark side?
I suggest to add an extra lightsource (sun) and tick off everything except specular highlights as shown in the image below.
Then it is just a matter of adjusting the strength, heading and elevation.

Title: Re: How do I set a light to only cast spec?
Post by: JimB on June 20, 2008, 05:49:15 AM
Quote from: gregsandor on June 19, 2008, 07:41:56 AM
Thanks, Jim.  Any ideas that will keep this to one pass?
Sadly no. T-U's idea is good though, but I'd try keeping 'cast shadows' switched on to avoid light seeping through the planet and illuminating the undersides of clouds, and displaced terrain, on the opposite side.
Title: Re: How do I set a light to only cast spec?
Post by: Tangled-Universe on June 20, 2008, 07:50:16 AM
No keep shadows off otherwise the shadows will be incorrect...logically.
If you only enable "cast shadows" and still uncheck shadows in terrain and atmosphere the result will be the same.

I see what you mean by your suggestion but for a still-image it isn't a problem at all, maybe for an animation it is.
Even then I doubt whether the light will seep through because disabling shadowcasting doesn't make the surfaces transparent suddenly?
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 20, 2008, 02:25:41 PM
In this case I'm lighting spaceship models, no planets or atmosphere. All I really want is just a glint on the back edges and no direct illumination.  Turning off the options except Specularity still throws visible light.  The closest its getting is with a low intensity dark grey light casting shadow. 
Title: Re: How do I set a light to only cast spec?
Post by: rcallicotte on June 20, 2008, 03:20:56 PM
Have you tried using Reverse Primary Rays?  I'm not 100% on what that does and Oshyan explained it once.  I know it changes the direction of the lighting and makes some changes to how things look.  It's under Render - Other Settings.
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 20, 2008, 03:22:31 PM
Calico I will try that.  Thanks.
Title: Re: How do I set a light to only cast spec?
Post by: Matt on June 26, 2008, 07:37:11 AM
There's no way to do this, unfortunately. I have been avoiding certain options in the shaders and lightsources which give physically implausible results, although I haven't strictly followed this throughout. I realise that it's a useful artistic tool to be able to cast only specular reflections from a particular light source, but I would encourage you to increase the specularity/reflectivity of your materials and use a darker light source instead. With the right index of refraction and lighting angles I think you should be able to get realistic results from both your key light and back/spec light.

Matt
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 26, 2008, 07:50:22 AM
Okay, thanks.  I can adjust my shaders and lights.
Title: Re: How do I set a light to only cast spec?
Post by: Matt on June 26, 2008, 07:55:06 AM
I've just realised that there's a contradiction there. I allow you to disable specular but not diffuse. Disabling either is "physically implausible", so why should I allow you to disable one but not the other?

The ability to disable specularity was useful for fill lights whose contribution was only intended to be a substitute for diffuse global illumination, but not having global illumination is already an implausible situation.

I can probably add a diffuse (or specular-only) checkbox in future but I'm massively in favour of doing my bit to encourage lighting setups that are analogous to those in the real world.

I'd like to see some early examples of your project and discuss how much can be done by changing your materials and lighting angles.

Matt
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 26, 2008, 08:50:35 AM
In this case I want to add a bit of a hit on the underside of a spaceship, to make it stand out against the blackness of space.  Rather than light the surface (actually the realistic way) I thought I'd kick just a bit onto the shiny parts, for some "hot" reflections.  In general I prefer real-world solutions too but it would be nice to allow for some cheats.

In the attached images, the Sun is at 0 degrees azimuth, 16.875 degrees altitude Intensity at 6 or 8.  In the second image there is a second sun at 180 degrees azimuth, -16.875 degrees altitude Intensity 0.25 (shadows on).

Much more than any other feature I really would like/must have the ability to parent objects and lights to each other -- in this case I want to fly ships with pointlights in the engines, and with even a couple of ships it is impractical to individually animate each attachment.  If you have any suggestions on how I can hack that up (or induce you to add that soon) I'm eager for it.
Title: Re: How do I set a light to only cast spec?
Post by: Matt on June 27, 2008, 05:17:04 PM
Thanks for showing those Greg. It looks as though you might have some luck by increasing the index of refraction and/or reflectivity on your surfaces. The highlight on the sun side would also get brighter of course, but I don't think that would be a bad thing. Perhaps in other images it wouldn't work so well. Maybe a different lighting angle will bring out the specular more; maybe this will become more apparent once it's animated. I will look into adding more controls after 2.0 "final" release.

Quote
Much more than any other feature I really would like/must have the ability to parent objects and lights to each other -- in this case I want to fly ships with pointlights in the engines, and with even a couple of ships it is impractical to individually animate each attachment.  If you have any suggestions on how I can hack that up (or induce you to add that soon) I'm eager for it.

A general solution for all objects is probably not possible for 2.0 final, but light sources would be much simpler. I have been looking into allowing light sources to be parented to other objects, nulls or light sources in a way that could be extended to all objects later on (which will require a lot more planning and testing). It really depends on how fast we get everything else done first.

Matt
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 28, 2008, 02:05:55 AM
Quote from: Matt on June 27, 2008, 05:17:04 PM

A general solution for all objects is probably not possible for 2.0 final, but light sources would be much simpler. I have been looking into allowing light sources to be parented to other objects, nulls or light sources in a way that could be extended to all objects later on (which will require a lot more planning and testing).
Matt


Good, thanks, Matt.  I don't even require any planning and testing:  any way to make a null object follow a path, with a bunch of tie fighters attached at 0 0 0 that I can then individually raise and lower, move side to side, and alter pitch yaw and roll to give individuality to the squadron...
Title: Re: How do I set a light to only cast spec?
Post by: Tangled-Universe on June 28, 2008, 07:27:38 AM
Quote from: Matt on June 27, 2008, 05:17:04 PM
Thanks for showing those Greg. It looks as though you might have some luck by increasing the index of refraction and/or reflectivity on your surfaces. The highlight on the sun side would also get brighter of course, but I don't think that would be a bad thing. Perhaps in other images it wouldn't work so well. Maybe a different lighting angle will bring out the specular more; maybe this will become more apparent once it's animated. I will look into adding more controls after 2.0 "final" release.

Quote
Much more than any other feature I really would like/must have the ability to parent objects and lights to each other -- in this case I want to fly ships with pointlights in the engines, and with even a couple of ships it is impractical to individually animate each attachment.  If you have any suggestions on how I can hack that up (or induce you to add that soon) I'm eager for it.

A general solution for all objects is probably not possible for 2.0 final, but light sources would be much simpler. I have been looking into allowing light sources to be parented to other objects, nulls or light sources in a way that could be extended to all objects later on (which will require a lot more planning and testing). It really depends on how fast we get everything else done first.

Matt


Oh wow, that sounds really good Matt :) Those would be some nice features!
Title: Re: How do I set a light to only cast spec?
Post by: Matt on June 28, 2008, 12:34:53 PM
Quote from: gregsandor on June 28, 2008, 02:05:55 AM
Good, thanks, Matt.  I don't even require any planning and testing:  any way to make a null object follow a path, with a bunch of tie fighters attached at 0 0 0 that I can then individually raise and lower, move side to side, and alter pitch yaw and roll to give individuality to the squadron...

Actually I meant planning and testing on our part. Implementing a robust parenting system for geometry when the various components of the renderer and the interface aren't already designed to do this certainly requires a lot of planning and testing. Light sources are a simpler case where less can go wrong.

Matt
Title: Re: How do I set a light to only cast spec?
Post by: gregsandor on June 28, 2008, 01:16:56 PM
That's what I meant, sort of tongue-in-cheek.  It doesn't have to be fancy; I want to be able to move a parent object to 0 0 0 and tell a bunch of other objects to each be x meters away from it, at whatever orientation.  Then when I move it to 55 100 0 or whereever, they also move and I can animate their distance and orientation in relation to the parent object rather than the world.  A simple text input in the UI by default can show "World" as parent, and can be changed to the name of the new parent object.  I can send you an example of what I mean.
Title: Re: How do I set a light to only cast spec?
Post by: Matt on June 28, 2008, 01:31:22 PM
I think I understand. It would be slightly simpler to implement when there's only translation of the parent to consider, but I can't really implement half-complete solutions to things at this stage unfortunately. If I get a chance to implement lightsource parenting and during the course of that it turns out that everything appears to be fairly straightfoward, I may be able to do it for all objects. There are a lot of ifs in that though ;)

Matt