Jump to content
The Dark Mod Forums

Directional Based Visibility?


Epifire

Recommended Posts

So here's an idea that's really off the cuff that sorta hit me in the middle of the night. Now I'm not asking this feature to be built, I'm simply just asking how valid something like this could be. For our coder minds out there.

 

So I was thinking to myself what dynamic lightshafts do in modern engines and then I started thinking to myself what an older engine might be capable of doing. Naturally that all sounded like a lot of craziness to me so I just started breaking it down into what I already know, which is geometry. Now we already have alpha planes working in TDM for light shining out of windows, to simulate particles and so forth. What struck me as interesting were if there were a kind of light shaft (similar to the mesh based) but controlled visibility by the player's look orientation. I'm not even sure if this is possible, but how it would work is you would have a single mesh (or even multiple ones split between different area portals). It would take some work but as the mapper you'd export a basic layout of your map when finished, or nearing completion. Then you'd decide where you want the lightshafts to go, but the important thing is it would have to be oriented to the world's light angle. Or more specifically the moon (since obviously we're talking night time maps). The difference between this and a normal lightshaft is that it would only render when you look at the moon basically. Because the mesh would be tied to an entity that checks for the player's look direction and only starts to render at a certain angle. The specific angle values would likely be something the mapper could edit, but it would be really useful indoors for when looking out a window, or around hanging objects outside.

 

So exactly how plausible would something like this be in code terms?

 

 

 

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

It sounds do-able, probably with a shader program so wouldn't even need to wait for a TDM update. But I haven't grasped the idea. Light beams revealed by floating dust are always visible whether or not you can see the light source.

Link to comment
Share on other sites

Might be able to use trigger_facing but you'd have to get the angle value and use it as part of the alpha or brightening

process. Sounds doable. I guess Sikkmod has some lens flare that acts like this so you could also look at the code there but

I suspect he's tied those to his crazy post-process setup so it might not be a good pure implementation.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

It sounds do-able, probably with a shader program so wouldn't even need to wait for a TDM update. But I haven't grasped the idea. Light beams revealed by floating dust are always visible whether or not you can see the light source.

 

Yeah I probably should have rephrased that a little better, as I was typing that up quickly before heading to work. I think the best way to explain it is more light flare/bloom rather than a normal lightshaft. I have nothing against static lightshafts and am not insinuating this should completely replace them. More as something to complement existing areas and settings. I'm thinking of this brightening effect that's based off the silhouette of objects between the viewer and said light source...

 

 

LightShafts.jpg

 

 

It's more the act of simulating this over-brightening effect seen in the shot above. It's only present when staring into the sun and gradually tapers off when you look away. At least that's how the classic system in the old UDK worked. The major difference is that the dynamic process is far easier (since it's a post process effect) but the concept of manual setup shouldn't be too terribly different. At least not in concept.

 

I'm not sure if this effect would work better with mounted sprites (with a fixed axis to the light source) or just really in depth planes positioned around object edges. The other thing would be that you would really only want the effect to be present towards the center of your screen. Otherwise the transparency ramping off to the sides of the screen would lose the effect completely if outdoors. So it's still sorta a complex matter, and would probably require it's own custom shader. Just some food for thought at the very least, and I would definitely volunteer to help try something like this. For what limited knowledge I have in producing meshes in the id4 that is.

 

EDIT: Just thought a bit more on this. Even if there wasn't a light flare system directly tied to a world light it would be a very handy entity to use just as a controlled light boost to be used by a mapper.

Edited by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Sounds like you want HDR? (High Dynamic Range).

 

Source uses it for similar situations to the picture posted. In a dark room walk out a door into the light and it blinds you for a second then fades.

 

Lightshafts aren't really the same though. As stated above they are just dust particles lit up by a faint moonlight. Moon isn't bright enough to blind you. Could be good for daylight missions though.

Link to comment
Share on other sites

Sounds like you want HDR? (High Dynamic Range).

 

Source uses it for similar situations to the picture posted. In a dark room walk out a door into the light and it blinds you for a second then fades.

 

Lightshafts aren't really the same though. As stated above they are just dust particles lit up by a faint moonlight. Moon isn't bright enough to blind you. Could be good for daylight missions though.

 

Yeah Gestas, very similar and though I guess the current shader system could probably manage this partially. The difference is that you'd have much more control over just standard bloom methods. If the material were linked to a local world entity that is, then you could have some really powerful lighting features.

 

 

Something like the sun rays in this video?

 

Yep, with that of control you'd be able to manage something close to that. Except a little less accurate to the player's view angle depending on how the planes would be setup. Or if you were to say, just orient sprites to the angle of the light entity you're trying convey. Only thing I'd do different, is that in the Unity demo there, the effect is seen popping over every rooftop, whereas I would just try and maintain a trace to the actual light source.

 

Do note that this could be very easy to overdo, (and then it would look downright awful) but if done right it could add some very nice,s subtle touches to existing lighting within that's already in the engine.

Edited by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...