Jump to content
The Dark Mod Forums

Projected lights


Recommended Posts

I did some investigating into why projected lights don't render properly, and this is what I found.

 

1. Projected versus omni lights are detected correctly in OpenGLShaderPass::flushRenderables(), which is where the maths calculations happen.

2. The projected light is rendered as if it were stuck at the origin, and does not move with the actual light volume (although the brightness does change if the light volume is moved, suggesting that the falloff texture coordinates are still changing).

3. The rendering calculations seem to make use of the origin of the light's AABB. This makes some sense for non-rotated omni lights, but not for projected lights as far as I can see.

4. The actual AABB for projected lights is not correct for rendering -- it only includes the selectable points rather than the whole volume (which extends on BOTH sides, not just towards the point). This is fine for the selection system but doesn't seem appropriate for the renderer.

5. I am not certain what RendererLight::offset() is required to do, but it seems to be returning the vector of the target point relative to the origin point.

 

I am not sure what the exact problem is because I don't fully understand the maths, but it looks like there is some confusion at a code level of how the calculation should be done. Perhaps some thought is needed regarding what methods should be on RendererLight and what values they should calculate, so that the omni and projected light calculations both make sense.

Link to comment
Share on other sites

It would be incredible if this could be fixed, as it stands, having to place projected lights in the editor and then having to go into Doom 3 and dmap and then go into the map to see if everything lines up right, is really frustrating. Take your time man, even as it is this is still one of the best editors I've ever used. :wub:

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I don't mind having to check in-game mainly because I'm already used to checking in-game for all other lighting anyway!

 

But I know what you mean, at least having SOME sort of indication right in the editor would be welcome.

shadowdark50.gif keep50.gif
Link to comment
Share on other sites

I was about to compare the code to the GtkRadiant one some time in the past, but failed due to some compilation failures (couldn't get GtkRadiant run in my debugger, but I guess I didn't try hard enough). The code in GtkRadiant works fine, if I recall correctly, so to fix this we could just investigate the differences.

 

I haven't looked into the maths at all yet, so I can't really comment on these things.

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...