Greetings!

Welcome to Scifi-Meshes.com! Click one of these buttons to join in on the fun.

Directional lights in Lightwave 3D?

SebastianPSebastianP171 Posts: 0Member
I'm trying to come up with a way to set up the lighting on my ships so that the port/starboard red and green lights only show up from the proper viewing angles, regardless of the distance. I've tried doing it with geometry, but that's only good for close up work, as the light-source polygons become too small for the camera to see eventually. Forcing the light material to render causes the lights on the other side of the ship to become visible once the ship itself becomes too small, which is what I want to avoid. Also, the geometry solution is not very exact...

Lense flares were another option I tried, but in that case I either have to put the lense flare outside of the lantern casing, or turn on "visible through objects" which means the lantern on the other side shows up as well.

I know spotlights can be made to emit light in specific directions, but they're not visible in themselves and turning them into lense flares have the problems mentioned above, plus the lense flares themselves are omnidirectional.

Does anyone have an idea how to get around this? Envelopes, etc?
Post edited by SebastianP on

Posts

  • IRMLIRML253 Posts: 1,993Member
    I don't quite understand what you're trying to do, could you explain the first paragraph again? I'm sure there'll be a way to do it whatever it is
  • SebastianPSebastianP171 Posts: 0Member
    OK, I'll try.

    I'm trying to create lanterns that are only visible from certain angles, without them either suddenly disappearing due to being too far away, or suddenly showing up despite being on the other side of the ship due to the ship itself being too far away.

    Examples of such lights include position lights, like the red and green lights on ships and aircraft, which are variously visible in arcs of 270 (front, left, right, but not back); 135 (visible from dead ahead and from one side, but not from the other or from astern), and 90 (visible from astern, but not otherwise) degrees. Other used for them would be the deck lights on a carrier (these are white or blue when viewed from astern, but red when viewed from the front, to tell the aviator that this is *not* the right direction...), or the meatball on a carrier deck, which shows up as three different colors depending on whether you're high, low or centered on the proper glideslope.

    I've looked around at the envelopes and expressions, but anything I can find which involves camera angles applies only to one camera...

    Edit: most of these lights are very commonly mounted on masts, especially the very wide angle ones. Rigging a mast-top light that shows up from every angle except 45 degrees to either side of dead astern is silly hard...
  • IRMLIRML253 Posts: 1,993Member
    right I see now, I didn't get what you meant until your meatball example

    but I still don't get this bit:
    SebastianP wrote: »
    .....without them either suddenly disappearing due to being too far away, or suddenly showing up despite being on the other side of the ship due to the ship itself being too far away.....
    as it should be a purely angular effect I don't see why distance would be a factor
  • SebastianPSebastianP171 Posts: 0Member
    Lightwave won't render stuff that it figures won't be visible (i.e. anything that would come out as less than a pixel). This is bad because the glow filter acts on single pixels and makes them large enough to be visible, but won't act at all on nothing, so a ship's lights will disappear rather abruptly at some point, while the ship itself is still visible.

    You can force Lightwave to render a material as at least one pixel regardless of distance, using tricks like the "render outlines" property. If you do, the lights won't disappear no matter how far away they are - but the *ship* will disappear at some point, leaving the *all* the lights visible, even the ones that are on the far side of the ship, and since the glow effect applies equally to both sides, the transition is rather sudden.

    The project I'm working on which is most affected by this is a carrier, which as I said has lights which are supposed to be red from one direction and white from the other. I can make lights like that using geometry (build a squat, truncated pyramid, select two opposing sides and bevel a deep recess from either side, and assign a glowy material to the bottom polygon). The problem is, without "render outlines", half the lights won't show when the camera is in the approach area; and with "render outlines", the carrier goes from white or red to bright pink once the rest of the light fixture stops rendering.

    What I want is a way to tell Lightwave that "this object should only be visible from such and such an angle". That way, it wouldn't matter if the ship vanished and left the lights, those lights which shouldn't be visible from the direction of the camera at this time would remain invisible...
  • count23count23361 Posts: 781Member
    do a quick demo render so we can see what you mean exactly. It's still a little unclear as to what you mean.

    But you're looking for a "falloff angle" in the settings for your light. If viewingangle > x amount, make not visible, etc...
    Formerly Nadesico.

    Current Projects:
    Ambassador Class
  • IRMLIRML253 Posts: 1,993Member
    SebastianP wrote: »
    Lightwave won't render stuff that it figures won't be visible (i.e. anything that would come out as less than a pixel). This is bad because the glow filter acts on single pixels and makes them large enough to be visible, but won't act at all on nothing, so a ship's lights will disappear rather abruptly at some point, while the ship itself is still visible.

    You can force Lightwave to render a material as at least one pixel regardless of distance, using tricks like the "render outlines" property. If you do, the lights won't disappear no matter how far away they are - but the *ship* will disappear at some point, leaving the *all* the lights visible, even the ones that are on the far side of the ship, and since the glow effect applies equally to both sides, the transition is rather sudden.

    The project I'm working on which is most affected by this is a carrier, which as I said has lights which are supposed to be red from one direction and white from the other. I can make lights like that using geometry (build a squat, truncated pyramid, select two opposing sides and bevel a deep recess from either side, and assign a glowy material to the bottom polygon). The problem is, without "render outlines", half the lights won't show when the camera is in the approach area; and with "render outlines", the carrier goes from white or red to bright pink once the rest of the light fixture stops rendering.

    What I want is a way to tell Lightwave that "this object should only be visible from such and such an angle". That way, it wouldn't matter if the ship vanished and left the lights, those lights which shouldn't be visible from the direction of the camera at this time would remain invisible...
    ok I get you, but I'm not sure how true what you said is - I'm sure all cg apps render sub pixels, which would make far away ships much less of an issue, in my experience as long as you have good AA settings and have your navlight surface sufficiently bright then it will show up

    ^take note of the bit in bold - that might work out better for you than using render outlines

    so anyway from what you said it sounds like you are doing this as a material effect? in that case it should be much easier to do this effect, if it was a light you would probably have to use relativity expressions

    I'll wait for you to post some screenshots or something like nadesico said, you have to understand that while you know what you want to do in your head, we don't, so you have to explain more clearly than you think, for example there was no way we could understand that "forcing the material to render" meant turning on render outlines
  • MelakMelak332 Posts: 0Member
    I'm not a lightwave user, but I don't follow exactly why geometry doesn't work for you. Example I made in max:
    0II7s.jpg

    Even the very distant lights still show up
  • SebastianPSebastianP171 Posts: 0Member
    Sufficient brightness is not the problem, stuff will disappear even if the luminosity is cranked up to 10,000 percent...

    Sorry about the lack of clarity, I've been on an inspiration kick and right now I've been working on one series of ships for near enough thirty hours straight (had a two hour nap this morning...)

    http://s21.photobucket.com/albums/b275/sebastianp/directional%20light%20demo/

    I built a very simple carrier deck setup with lights that are blue from one side and red from the other. Each light is built from a very low truncated pyramid, with a recess beveled into two opposing sides. The polygons at the bottom were assigned a material with red (FF0000h) and blue (0000FF) color respectively, a luminosity of 500 percent, and 50% glow intensity (glows were turned on in the processing options as well).

    The renders in the album are named (color)_(range)_(outlines).png, where color is red or blue; range is veryclose (y=1m, z=-10m), close (y=40m, z=-400m), far (y=100m, z=-1km) and veryfar (y=200m, z=-2km); and outlines are no outlines, or small outlines (render outlines = 0.2 pixels).

    As you can see from the pictures, even at "close" range, without outlines not all the lights show up. From "far" range, all the lights vanish. Even cranking the luminosity up to 50000% did not make any difference. With render outlines, the lights will mostly show up properly at "far" range, but "very far" causes some of the lights from the opposite direction to show up. This is especially evident with blue_veryfar_small_outlines.png.
    Also, at "very close" range the lights look strange, and some of them show up from the wrong side here as well.

    I've zipped up the object and scene file, they're in the attachment.
  • IRMLIRML253 Posts: 1,993Member
    now you've confused me again, this has nothing to do with the carrier landing system example you mentioned, that is a fresnel lens that projects different coloured lights through the same aperture, this is just 2 completely seperate lights facing opposite directions

    you realise what's happening when you select render outlines right? it renders that surface as a wireframe, the side effect of that is it becomes mostly transparent, that's why the other side is showing through

    ps. wow photobucket really sucks, whoever came up with that image viewer is a mental
  • SebastianPSebastianP171 Posts: 0Member
    I mentioned deck lights with different colors in different directions in post #3... it was one of the easiest to demonstrate. And yes, I do know that it renders the polygon as a wireframe, but at the distances normally involved in a fleet shot, that's about the only way that a light source polygon will show up at all. :(

    Photobucket sucks rocks, yes. There is a very simple reason why I'm using PNG these days, for example, and that's because Photobucket decided to resave all my jpegs with the highest possible compression. But they can even mess up those - if the filesize is too big, they'll shrink the image with some awful resizing filter, and it looks like crap afterwards.

    Here's a "live" example of what I'm trying to accomplish:

    th_battle_line_001.png

    (edit: switched full-size image to a thumbnail since the forum resizes outsize images)

    Each of these ships should be equipped with two white masthead lights (top and bottom), a red and green wingtip light (red facing the viewer), a white bow light, and a white stern light. Except for the stern lights, all of these should be visible from an angle of up to 135 degrees left or right of the front, while the stern lights should be visible from 45 degrees to either side of dead astern. The stern lights are currently obscured (I put something on top and haven't gotten around to fixing it yet), but four ships in the bottom row (1, 2, 3 and 6) have the rest of them in their proper places and using the best method I've come up with so far. As rendered, ship number 6 is the only one where all the lights are visible; number three is missing the bow light, number two the top masthead light, and number one is missing all of them. (in the top row, ships four and five are supposed to be identical to each other, but number four is the only one which shows a red wingtip light). The farthest ship is the only one of the lot that might have reached the cutoff angle, but my guess is that it's due to the distance.

    What I'm looking for is a way to have all the lights show up appropriately, brighter than they are now, without losing the bright colors (I can't make a lense flare that kind of red...) and without having to make the lights bigger than they are currently (the light fixtures are round, 80 cm across and 25 to 50 cm tall. which is about eight times bigger than the real-world lights I tried to model them on - the ships themselves are only about three times the size of their real world counterparts. When I sit down to make real-world ships, this problem will be even more pronounced...)

    *Is* there a way of doing this, short of rendering the lights on their own layers (which wouldn't be very dynamic) and using those to add lense flares in Aftereffects?
  • Mr. WildeMr. Wilde197 Posts: 121Member
    Yeah, I have similar issues every time I want to render my Spacedock model with its 60,000+ windows. A high anti aliasing level and a very high luminosity setting (depending on the render size, I already ended up with 50,000%) usually do the trick. Highly overexposed geometry, no matter how small, will show up and will be anti aliased.

    I also found that the FPrime renderer is pretty much unbeatable in exactly these situations, so I mostly render the station with the LightWave renderer, and the light/window pass in FPrime.

    You can also render the separate light pass twice as big or larger to make sure that tiny geometry shows up.

    Here are a couple of examples: the first is with luminosity set to 250% and an AA level of 32. The second is with luminosity set to 25,000%. And the third is the FPrime render in almost half the time. And for the heck of it another LightWave render with luminosity set to 25 million percent.
    91486.png91484.png91485.png91487.png
  • IRMLIRML253 Posts: 1,993Member
    SebastianP wrote: »
    *Is* there a way of doing this, short of rendering the lights on their own layers (which wouldn't be very dynamic) and using those to add lense flares in Aftereffects?
    yes, but personally I think wilde's way of rendering the nav lights at 2x resolution is the most foolproof method


    ok first suggestion, don't do render outlines on the lights, put a 2 point poly just in front instead, this way you keep your light looking normal, you don't see through to the outlines on the other side, and you still have something there for a minimum pixel size

    Clipboard01.jpg

    secondly lightwave doesn't decide to not render things if they are smaller than a pixel, the reason you are seeing the light from the other side is a combination of: a - your light polys were just outlines and were basically seeing through to the colour on the other side, and: b - because when you do render outlines the results still have a real presence in the scene, the difference is as they're scaled by pixels they don't get smaller the further away they are from the camera, so eventually as the real geometry becomes smaller and smaller the pixel bits outgrow it

    here's an exteme example with the render outlines scaled to 30 pixels, you can see the render lines clipping through the geometry, this is the same thing that's happening to your farthest lights

    Clipboard02.jpg

    the only way I can think of beating that is giving the 2 point poly a different surface, the same as the light except with an expression controlling transparency, there may be something you could do with relativity or else it's very likely the expression would be camera dependent
    91488.jpg91489.jpg
  • SebastianPSebastianP171 Posts: 0Member
    "doh. Single and two-point polygons. For working on an entire scene full of them (the whole starfield is all single-point polygons) I should have remembered that they render just fine even at a huge distance (megameters!)

    Back to work, then. :-)

    SP

    (edit: ...except that it still doesn't work right. Once the camera is a couple of clicks away from the masthead lights, they are once again visible from dead astern, which they weren't supposed to be.. *headdesk*)
  • IRMLIRML253 Posts: 1,993Member
    SebastianP wrote: »
    (edit: ...except that it still doesn't work right. Once the camera is a couple of clicks away from the masthead lights, they are once again visible from dead astern, which they weren't supposed to be.. *headdesk*)
    read the last couple of paragraphs in my previous post for an explanation of why that's still happening

    if you want to correct it you'll have to attach an expression to the transparency of the 2 point polys, which will most likely be camera dependent

    wilde's way of rendering at 2x is the simplest and most flexible way of dealing with that problem
  • SebastianPSebastianP171 Posts: 0Member
    I finally figured out a way of doing it: Transparency maps! They apply to single-point polygons as well, and will mask them properly even when geometry won't. I've now managed to get all the lights to be visible at the proper angles. I'm getting some strange behavior from the maps though. Once I have a map that correctly masks off the rearmost 90 degrees for the masthead lights, inverting it should create one that masks the forward 270 to make a tail light, right? But when I do that, I *also* have to rotate the texture projection 180 degrees, or it points the wrong way. Also, try as I might I haven't been able to figure out the red and green lights properly, so I've used the transparency map for the masthead light for those as well, and hope the ship itself will be enough to mask the light from the wrong angle. (This will work so long as the lights are mounted on the wingtips, but it won't work if the lights are on the masts...)

    Anyway, I think I'm happy enough for now... :-)
Sign In or Register to comment.