Jump to content
The Dark Mod Forums

Tracker 3881: Cubemap Lighting Beta


nbohr1more

Recommended Posts

It's using the skybox and there is some sorta blur and sample action happening but perhaps I should see how it looks if I blur it. The test map has some fairly low resolution sky's and they work just fine so it's just a matter of whether you want your specular reflections to have lots of sky detail or not.

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

BTW, nbohr1more, could you check if having the compass out on the HUD freezes/messes up the screen for you? I've been having this persistent issue and it might be your patched .exe that's doing it, so I wanna isolate the cause.

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

I'll check. It would be strange to see a relationship there.

 

I would be more inclined to think that the new inventory GUI would be the culprit.

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

BTW, nbohr1more, could you check if having the compass out on the HUD freezes/messes up the screen for you? I've been having this persistent issue and it might be your patched .exe that's doing it, so I wanna isolate the cause.

 

 

I'll check. It would be strange to see a relationship there.

 

I would be more inclined to think that the new inventory GUI would be the culprit.

 

 

I tested in 2.03, 2.04 vanilla, and my build.

 

No freezes or glitches when the Compass is active. I spawned via:

 

spawn atdm:playertools_compass

 

then toggled to the Compass and all was well.

 

I also performed

 

testModel atdm:playertools_compass

 

with no trouble.

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

Thanks for testing it out, it was ReShade again. Something to do with the compass being a 3D model being drawn on top of the screen I bet, still extremely weird.

 

Yay, the cubiclights look way better now! Now one doesn't need to put alpha channels or anything to make it look projected. Couple of things, probably because the simple interaction shader isn't updated, when you switch to simple interaction the shader goes back to flat light which can have gameplay consequences. The light edges on models are still way sharper when compared to the regular lights, too.

 

Right now, the one problem is that the lights don't project the images properly, stretching them much like the regular lights does. Here's a video:

 

https://dl.dropboxusercontent.com/u/655334/ShareX/cubic_stretch.webm

 

Ideally it should behave like this, this is the behaviour when you put cubemaps' alphas to, like 50%:

 

https://dl.dropboxusercontent.com/u/655334/ShareX/cubic_alpha.webm

  • Like 2

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

Hmm, are these examples using cubemap or cameraCubeMap ?

 

Would it be possible to post a test map of that?

 

I'll look into the issue regardless, of course.

 

Edit:

 

I see our old friend z-fighting is back.

 

I think I'll do the sane thing and make branches for point vs projected in the ARB bind

and get rid of the projection detection in the shader.

 

Eg:

 

backEnd.vLight->lightDef->parms.pointLight

  • 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 tried both cubemap and cameraCubeMap. It's broken on both of them. The z fighting is only visible if you have an alpha channel on the cubemap, as I said, but putting an alpha also makes it display correctly.

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

Yeah, I was running on the assumption that the w coordinate in the vertex shader was related to the internal projection matrix.

It looks like you hit the nail on the head. The alpha channel is being packed into w and that is the toggle for the projection check

thus I need to stop that by hard coding what projection happens where.

 

Edit: Hah it's probably worse than either of us thought. The fourth coordinate for ARB programs is undefined in the spec so the driver

developers probably monkey around with it.

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'll upload another executable tonight ( I got the internal point vs projected switch working based on the exp render etc).

 

I foolishly tried to edit the shader to fix the projection last night and got into a big round of untangling the two shader paths.

 

I forgot that working isolated examples exist here:

 

https://github.com/nbohr1more/Sikkpin-Feedback/tree/master/shaders

 

oh well, not too much time was wasted.

  • Like 2

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

New build!

 

https://dl.dropboxusercontent.com/u/17706561/cubicLightPatch.zip

 

5 ARB shaders ( test vs standard and pointLight vs Projected, and the ambient ( ambient still has both point\proj but I'm considering hard-coding pointLight ).

 

Looks like we're about 99.99% there 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 can see the projection is working correctly now! I also like that the fresnel on the cubelight is subtle enough that it doesn't over power any real lights you'd want to put with it.

 

Is there any new material keywords to use besides cubeLight and ambientCubeLight now? I'll play around more with this tomorrow and maybe I'll even take up that idea of redoing the outdoors area of Caduceus for show. I should also think about a way of remaking the desk lamp light textures into a cubemap - it's the most well known light oddity as those desk lamps are in a lot of maps, so it'd be an effective way to proselytize the benefits of cubic projection.

 

EDIT: I'm not sure but I think cameraCubeMaps work for "cubecLight" but cubemaps do not. They do for "ambientCubicLight" though.

Edited by Spooks
  • 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

Thanks for your help and testing!

 

No new keywords needed but I'm gonna look into fixing the nospecular light entity issue so you have a little more flexibility in use-case.

 

I'm also gonna look at the smoothnormals keyword and see if I can copy the blur section so folks who don't want strong environment reflections

in the specular can tone that down without cracking-open GIMP\Photoshop.

 

I will try to dig around for free sample unity cookie lights to make a few more lights.

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

Here is a executable which allows you to use the "nospecular" arg on a Light Entity:

 

https://dl.dropboxusercontent.com/u/17706561/nospecularPatch.zip

 

I couldn't get nodiffuse or nobump to work as the plumbing for those is almost non-existent.

nospecular is far more complete.

 

It looks like id Software wasn't sure they wanted to implement the others?

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

Thanks, really appreciate you looking into it. The good news is using the cubemap vertex programs can more or less fake nodiffuse now. Put a pitch black cubemap on a ambientCubicLight, it would just display a specular and nothing else, which is pretty much what a light with nodiffuse would be. It could even be added as a prefab light. I guess ambient lights are pretty much a nobump light too.

 

What "nospecular" will allow mappers to do is - with the addition of ai_see 0 - make bounce lights to fake radiosity without wrong looking fresnel reflections. They can also combine nospecular and purely specular lights to fix the wrong fresnel appearance of very large lights like skylights or a sun/moon light. It's a lot more artistic control.

 

I've been musing about how to do some interesting stuff with cubemaps, like pre-baked lighting. Something like how Wolfire did it, but obviously manual. So far I'm thinking: apply material override of flat grey dev texture, take an envshot exactly where you want your cubemap to be (it will take a shot of the ambient lighting, more or less), go into your cubemap images and selectively blur them, apply cubemap as projected cubelight. If you want IL/radiosity, take an envshot without a material override, blur cubemap, use as cubelight with "texgen reflect". Proof is in the pudding, must get around to some experiments.

  • 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

Yeah, I've got some ideas kicking around to make this work more like a proper light probe setup.

The spectrum keyword can pair a light with a surface material so there's some architecture there

that might help with this.

  • 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've not been able to make my custom cubemaps show as cubicLights (they do appear as ambientCubicLights though). Through trial and error I've managed to find that for a cubicLight to work, all six images still need to have a dummy alpha channel that is neither completely black nor white. If that could get fixed it would be great because as it stands this would inflate the already large .tga sizes and isn't intuitive at all for new users who want to make custom light textures.

 

Painting over the alphas can also produce some very weird artefacts, so I don't think it's like they get used in any meaningful way either, it's still something to do with how the projection is handled...

 

edit: i forgot to mention that when you use a nospecular on an ambientCubicLight, it just turns it off. I suppose it makes sense because the cubemap interacts with the specular channel only, but IIRC your intention was disabling the fresnel on command. Don't know if this is worth "fixing", the argument works fine on normal lights otherwise.

 

e:e: As a matter of fact, when you flick "nospecular" on on an ambientCubicMap, the cubemap goes away, but the fresnel remains! Something's definitely wrong there. Here's a picture. The blue tint is an ambientcubiclight with nospecular 1. There shouldn't be anything there.

Edited by Spooks
  • 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

Yeah, I was fiddling around last night and found that r_lightscale causes the light to become saturated with color.

 

I've gotta get the shader to work without this block I believe:

 

SLT ambient.w, ambient.w, const.x;
CMP_SAT light, -ambient.w, NdotL.x, ambient;
CMP specular, -ambient.w, specular.w, specular;
CMP_SAT atten, -ambient.w, atten, atten.w;

 

Will keep grinding at it...

  • 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

  • 3 weeks later...

Most of the demo rooms look great. :smile: Just a couple of things, based on a quick play with the demo map:

 

1) As far as I can tell lights/cubesheen isn't illuminating anything. Are these rooms supposed to look like this?

 

post-35144-0-73537900-1474725485_thumb.jpgpost-35144-0-30860000-1474725493_thumb.jpg

 

2) I have no sense of what HL2 lighting is supposed to be like (I haven't played that game since it came out), so I'm trying to infer from looking around the map what the rationale is supposed to be: rooms like the mountain sunet one make me think, okay, the sunset in the skybox is presumably to the West, and the red glow on the surfaces is therefore on the Westward-facing ones, so the appearance is as though the surfaces are reflecting the sky. But then you have this room...

 

post-35144-0-11536700-1474725500_thumb.jpgpost-35144-0-55223000-1474725508_thumb.jpg

 

...where there are big white centres on the top and bottom skybox faces, but upward- and downward-facing surfaces in the room show up black. The desert room is another case in point (blue sky above, sun off to one side, but the geometry is all golden and looks as though lit from above), but without a clearer sense of what I'm supposed to be seeing I can't tell whether something is wrong.

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

The cubesheen room has a rather low ambient light value. Mostly this was changed so that the projections

could be compared by spawning regular lights.

 

I'm not sure how the image in the upper right has black geometry. Perhaps a texture got missed in the pack file

but I completely wiped the pack and re-tested so something strange is happening there?

 

Main objectives:

 

1) Cubemap "cookie" lights the same that Unity has

 

2) Cubemap "probe" lighting. HL2 has this but so does Portal, Left 4 Dead, Counterstrike Source, basically and Valve game.

  • 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'm not sure how the image in the upper right has black geometry. Perhaps a texture got missed in the pack file

but I completely wiped the pack and re-tested so something strange is happening there?

Like I said, lights/cubesheen is failing to illuminate anything on my machine (I played with the ambient in the starting room too and that changed nothing unless I changed the light texture). The geometry shows up normally in lantern light.

 

Edit: lights/sheen* files show up normally in Irfanview.

 

Edit2: okay, the mismatched desert lighting arises because lights/cubedesert doesn't actually correspond closely to skybox_afternoon_02.

 

Edit3: here's lights/cubedome projected by a light in the centre of a cube of marble_white_001:

post-35144-0-15530600-1474815356_thumb.jpg

I can see the cubemap perfectly in the sides, including its top and bottom faces, but the top and bottom faces of the marble cube look outright glitched. I tried a couple of other lights from the demo and they didn't produce similar effects.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I did a little more tinkering with the shaders.

 

It should look much better when you set nospecular on the light entity.

 

Also some of the strange artifacts on angles should be cleared up.

 

https://www.dropbox.com/s/9fgl21nrwjtp1ud/nospecularPatch.zip?dl=0

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

Yes, I think this might be nearly the end of progress here.

 

I'm not sure how to remove the requirement of having alpha in the projection image for the Unity cookie-style lights.

The ambient cubemap works as intended mostly and a system to setup zone based control of it is scoped for another issue.

 

I'll do a little more tinkering this week and then close the ticket unless an ARB shader guru shows up to assist.

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

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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • 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.
      · 4 replies
    • 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
×
×
  • Create New...