Jump to content


Photo

Tracker 3881: Cubemap Lighting Beta

cubemap lighting

177 replies to this topic

#51 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 26 August 2016 - 07:54 AM

Ah that's very cool, and I assume the light image resolution is suitable low res or blurred so we get a nice ambient glow as per that shot..?



#52 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 26 August 2016 - 08:17 AM

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.c...ds/the-dark-mod

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

#53 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 26 August 2016 - 07:46 PM

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! |


#54 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 26 August 2016 - 09:50 PM

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.c...ds/the-dark-mod

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

#55 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 27 August 2016 - 09:45 PM

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.c...ds/the-dark-mod

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

#56 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 28 August 2016 - 02:11 AM

More work towards better standard cubicLight...

 

Attached File  test_cubic_light.vfp.txt   11.8KB   82 downloads

 

this should match TDM lighting more closely now.


  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#57 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 28 August 2016 - 06:06 AM

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.dropboxus...ic_stretch.webm

 

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

 

https://dl.dropboxus...ubic_alpha.webm


  • nbohr1more and Anderson like this

My FMs: The King of Diamonds (2016)

 

| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |


#58 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 28 August 2016 - 09:44 AM

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


  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#59 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 28 August 2016 - 01:19 PM

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! |


#60 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 28 August 2016 - 01:25 PM

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.c...ds/the-dark-mod

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

#61 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 29 August 2016 - 10:14 AM

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/n.../master/shaders

 

oh well, not too much time was wasted.


  • Anderson and Spooks like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#62 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 30 August 2016 - 12:37 AM

New build!

 

https://dl.dropboxus...cLightPatch.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. :)


  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#63 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 30 August 2016 - 03:15 PM

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, 30 August 2016 - 03:18 PM.

  • nbohr1more likes this

My FMs: The King of Diamonds (2016)

 

| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |


#64 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 30 August 2016 - 03:23 PM

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.c...ds/the-dark-mod

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

#65 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 31 August 2016 - 12:04 AM

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

 

https://dl.dropboxus...ecularPatch.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.c...ds/the-dark-mod

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

#66 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 31 August 2016 - 08:25 AM

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.


  • Anderson likes this

My FMs: The King of Diamonds (2016)

 

| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |


#67 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 31 August 2016 - 08:54 AM

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.


  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#68 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 534 posts

Posted 03 September 2016 - 05:04 AM

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, 03 September 2016 - 07:17 AM.

  • Anderson likes this

My FMs: The King of Diamonds (2016)

 

| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |


#69 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 03 September 2016 - 08:04 AM

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...


  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#70 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 903 posts

Posted 24 September 2016 - 09:07 AM

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?

 

cubic1.jpg cubic2.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...

 

cubic3.jpg cubic4.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, 24 September 2016 - 11:45 AM.

  • Anderson likes this

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#71 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 24 September 2016 - 11:12 PM

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.
  • Anderson likes this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#72 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 903 posts

Posted 25 September 2016 - 09:09 AM

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:

cubic5.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, 25 September 2016 - 10:00 AM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#73 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 26 September 2016 - 12:06 AM

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....rPatch.zip?dl=0
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

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

#74 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 903 posts

Posted 26 September 2016 - 08:14 AM

Ah good, cubedome displays properly now. :smile:


  • nbohr1more likes this

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#75 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9341 posts

Posted 26 September 2016 - 09:20 AM

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.c...ds/the-dark-mod

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



Reply to this topic



  



Also tagged with one or more of these keywords: cubemap, lighting

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users