Jump to content
The Dark Mod Forums

Tracker 3881: Cubemap Lighting Beta


nbohr1more

Recommended Posts

Sure enough, though I think this has been happening in old maps that I played with cubic lights in before I noticed the corruption as well, such as this one. Well I did move and replace the lights in the process of troubleshooting so I don't know. Cubegrate6 is in the end of the room you spawn in.

zoo.map.txt

  • Like 1

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

For the record, does this work with 2.05? I tried it out of curiosity last week with a fresh install and all it did was crash.

 

The functionality is included in the 2.05 executable and the shaders are packed with the mod so there's no need to use the old files here

other than possibly some of the materials that I excluded because they appeared to be copied from Doom 3.

 

In short, it should work and if you invoke "spawn atdm:lamp_desk_cubic" in the console a light entity with the new cubicLight type will spawn.

Have you tried your own material or entity? How is this crashing?

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

Sure enough, though I think this has been happening in old maps that I played with cubic lights in before I noticed the corruption as well, such as this one. Well I did move and replace the lights in the process of troubleshooting so I don't know. Cubegrate6 is in the end of the room you spawn in.

 

Issue confirmed. Not as bad as the video but there is some sorta artifact there. I'll keep tinkering.

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

That explains things. I replaced files in my 2.05 installation with those linked here and upon launch it immediately bombed out with the standard fair "Windows is having a problem ..." nonsense. Now I know why.

 

I never bothered trying much else because it was apparent it wasn't working. I'll give it another go when I have time later in the week and fix that lampshade projection while I'm at it.

  • Like 1
Link to comment
Share on other sites

Nice work.

 

I'm surprised the projection distance didn't blur the light images but a little gaussian on the texture should cure that.

I guess we could consider a blur in the shader itself. Eh, if you used a lower resolution image it would probably be blurrier too.

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

Hey, rich, do you have a good workflow for making accurate projection cubemaps like that? The feature would be more widely used if users could have a consistent way of making them. Nbohr1more, any news on the bug front?

  • Like 1

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

There is no all encompassing cube map editing tool so the methods you use will vary depending on what you're trying to accomplish. Google is my bread and butter here. As is often the case I used a collection of many programs to get the final output.

 

6iyVVQB.jpg

 

Here you can see I'm using Blender and the lampshade from the desk lamp model to capture the six images that make up a cube map (up, down, left, right, front, back). The cameras are placed inside the lampshade in the approximate position of the light source.

 

But you're not stuck using Blender. If you can position and orient a camera precisely and set the field of view to ninety degrees, anything with a 3D viewport could potentially work. Google Earth could be a potential source. Celestia could be another.

 

The one thing that is kind of difficult is post processing. Because the environment map is comprised of six separate images, you have to be mindful about the kinds of operations you perform. You need to be sure what you do carries across image seams. It's a bit like painting seamless textures in that not all programs are capable of handling the context so you might apply a blur filter and screw up the seams.

 

I haven't worked out an ideal solution for that yet. ATI's cubemapgen works for bluring a cube map. One idea I'm toying with is trying to convert a cube map from a cubic projection to something like equirectangular and back. This would allow you edit a single image as if it were a seamless texture, then convert back when you're done.

 

Aside from that, all you're doing is renaming files and occasionally rotating an image. Also in this specific usage case, whether it's a bug or otherwise, these cube maps need an alpha channel. I'm using Imagemagick and batch scripts to handle all that. It makes it fairly quick to render something out, process it, then test it in game.

  • Like 1
Link to comment
Share on other sites

Hey, rich, do you have a good workflow for making accurate projection cubemaps like that? The feature would be more widely used if users could have a consistent way of making them. Nbohr1more, any news on the bug front?

 

Sorry about the delay. The bug cannot be reproduced on our current SVN build. (One of Duzenko's render changes must've inadvertently fixed it.)

I'll keep working on a workaround for 2.05.

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

Well, one mystery is solved.

 

When Duzenko moved the post process shaders to the renderer, the tdm_interaction_type cvar broke.

Changing the GUI to use r_testARBProgram instead fixed that and... voila, I can now reproduce the bug in SVN. <_<:P

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

Anything I can do to help here?

 

If you have Nvidia hardware, see if you can figure out what in the "test_cubic_light_point.vfp" and "test_cubic_light_proj.vfp" is tickling

the driver bug and if there's another way to write these shaders that wont cause the bug. Of course, if you rewrite the shaders in any way

it's possible the bug would go away.

 

As a clue, Sikkmod 1.2 has a similar bug:

 

 

whereas Sikkmod 1.0 does not.

 

The frustrating this is that this group claims to know the fix for Sikkmod but wont share it until their next release:

 

http://www.scared-pixel-studios.com/forums/viewtopic.php?f=50&t=600

  • Like 1

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

OK, it looks like certain MAD operations are causing the bug.

 

I attached a replacement shader.

 

test_cubic_light_point.vfp.txt

 

Just create an override glprogs folder in your mission and rename with a vfp extension (eg. remove the txt extension).

 

I'll try to improve it by splitting the multiply and add operations but it's 99.99% functional now.

  • Like 1

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

I had to load a high specularity texture just to make sure it worked.

 

gVJiBt9.jpg

 

Sure enough, the specular's still fuzzy. I made sure I replaced the vpf correctly by disabling it and running the scene again. Without it, the wall on the left and the one on the right are corrupted, so it's definitely an improvement, but still not there. It's not that one side of the cubemap light is buggy and the other isn't, if I put the high spec texture on the left wall the specular will get fuzzy too. In addition I've noticed the left (in picture, down by default) image in cubegrate6 is inverted, I checked the textures of it to be sure and it shouldn't be the case. Same with or without the new .vpf.

  • Like 1

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

  • 6 months later...

@VanishedOne and Spooks:

 

Are some of the cubicLight problems being seen for projected lights?

 

As I recall, only "point lights" were implemented in GLSL. (After much begging...)

We weren't aware of any real compelling use case for projected lights with cubemaps so it

wasn't worth the battle at the time. If you really need projected cubicLights, I'll go back and

argue the case to Duzenko.

In the top image, in the starting room of ambientcube.map I've changed the middle light from projected to omni and resized its bounding box to restore the projection onto the floor. So the middle light is an omni cubegrate6 and the other two are projected cubegrate6.

 

post-35144-0-14563400-1510411888_thumb.jpg

 

I tried to get a side-by-side comparison with the regular grate6, but TDM either refused to load the map ('ERROR: Image 'lights/grate6' has been referenced with conflicting cube map states') or outright crashed. (Shall I file a separate tracker issue for that?) So here all three lights have been changed to projected, non-cubic grate6:

 

post-35144-0-62464900-1510411898_thumb.jpg

 

grate6 and cubegrate6 actually have a different grate image - the ordinary grate6 has more white near the edges - so here's a version of the second shot where I've overridden the grate6 image with one of the cubegrate6 faces:

 

post-35144-0-98129500-1510411909_thumb.jpg

 

(Edit: I originally said the cubic lights didn't have the wavy lines projected onto the back wall, but on close examination I can see them in the middle one; they're just weaker.)

 

If we assume the projection onto the ceiling is something you'd fix by altering the cubemap, then what stands out about the projected cubelights is their projection onto the back wall: it gives a much stronger impression of light hitting from above at a sharp angle.

 

On that evidence, I think projected cubelights merit further investigation. I'll post if I find anything interesting.

Edited by VanishedOne
  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

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

    • 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
       
      · 2 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
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...