Jump to content


Photo

Tracker 3881: Cubemap Lighting Beta

cubemap lighting

179 replies to this topic

#26 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 20 August 2016 - 09:57 AM

Now we have the "envshotGL" command that outputs the old style cube images imagename_nx (etc).

 

envshotGL <basename> size blend

 

I also tested evnshot and the right images are working. The console doubles the up name at the end but the images come out as expected.

Could I do a test of this with an existing map..?



#27 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 20 August 2016 - 10:04 AM

Yes. I was gonna experiment with the outdoor area of Caduceus now that you mention 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...)

#28 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 20 August 2016 - 12:11 PM

Well one of the things I have always wanted to do is create fake inside and outside textures that can be applied dot the inside/outside of windows.



#29 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 20 August 2016 - 12:33 PM

That is actually what SteveL fixed.

 

Just use the regular envshot command instead of envshotGL and then use cameraCubemap in your material.

 

No need to rotate and rename for that effect anymore.


  • pariah 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...)

#30 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 20 August 2016 - 04:33 PM

Ah yes of course he did, and I forgot :-)



#31 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 539 posts

Posted 20 August 2016 - 06:41 PM

I don't think the change has done anything to enable room projection, as you wanted in that one thread, though. I've tested both cubemap and cameracubemap as custom textures put on brushes and there seems to be no visual difference. It's why even after nbohr provided the engine comments to them I still think the two are just the same thing but one's just named more conveniently.


My FMs: The King of Diamonds (2016)

 

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


#32 pariah

pariah

    Member

  • Member
  • PipPip
  • 34 posts

Posted 21 August 2016 - 05:28 AM

Will this be in future TDM update, or remain optional and only in discretion of mapper?

How I bookmark thread in this forums?



#33 pariah

pariah

    Member

  • Member
  • PipPip
  • 34 posts

Posted 21 August 2016 - 05:55 AM

81fps, khvastun :P

Good work - light working. Replacement is breaking a normal-maps and can be prblem when intersecting geometry or many source of shadow but without FPS drop. Replace with nothing only diffuse texture and normal and is z-fighting light sources. This was strange.

This is no different from before, perceptable except in quality of "ambient" lighting and spherical harmonics.

 

I much prefer this method. It looks good and as nbohr1more has spoken, it is fiddly and it will stretch lights as realism and cut-off lights in good manner that is higher quality than before.

Does not work for pointed lights. But this is no issue.

 

Big thanks for demo files!!

Have you tried lighting from underwater yet? Is necessary to create "shodow" light for water refection, as water has no specular or shadow in this mod.

 

Ya nye ponimayu why people ask for screenshot when you have given files to demo, nbhoh1more..?

Must been seen and played to appreciating difference.

 

The method. I find how to "follo" thread, but i not find how to bookmark, so will this thread be link in wiki for searching back?

Will be good to have a way to find the tread again, without leaving ball of string "Cubemap+Lighting+Beta". ok.

 

But you know... I can still push AI guard out of map by hitting when he is standing up because cosh interrupt animation and reset... Then guard falls through world.

At least world is lit well, even if guard can be beated out of reality ))))



#34 pariah

pariah

    Member

  • Member
  • PipPip
  • 34 posts

Posted 21 August 2016 - 06:01 AM

Light fight is caused by alpha channel. Look no good. Can bleed outside and AI response is "blind" in "dim" area.

Can append info here? GPL render efficiency drop. Lekly due to fighting light. All the same or not.

Appendix to: http://wiki.thedarkm...title=Cube_maps ??

 

To return game to "normal", after test simply delete new files and rename *.bak (exe dll) to files original extension.

Or copy full game folder (\thedarkmod) to (\TDMbackup) then do steps, del \thedarkmod and rename \TDMbackup. Easy )


Edited by pariah, 21 August 2016 - 06:07 AM.


#35 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 21 August 2016 - 12:46 PM

I have a different hunch. Our light uses texture coordinate 7 for sky direction while this shader uses it for something else. I'll try moving it to 8 in the new shader when I get some time.

 

I mis-remembered what was there. There is a bias param in the vertex block and coordinate 7 appears to be hardcoded to worldspace.

I added the param to the cubic_light and it didn't break it but it didn't cure the z-fighting either (though this is another case where it seems reduced by placebo).

I will upload the map I edited so you can compare but I also can confirm that the z-fighting wasn't happening with my experiments on Biker's Caduceus map

so I am currently looking at two culprits:

 

1) Map geometry bugs (as always... I got the largest reduction thus far by simply rounding high precision vertex coordinates)

2) Heightmap blending. We rarely use this technique and it may be that newer drivers aren't playing nicely with it. (Gotta re-check the demo under vanilla Doom 3, it wasn't happening there.)


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

#36 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 21 August 2016 - 02:02 PM

Will this be in future TDM update, or remain optional and only in discretion of mapper?

How I bookmark thread in this forums?

 

I'm not a forum expert but the "Follow this Topic" button at the top would be the trick I believe.

 

Yes, this is intended to be included as an optional feature in an upcoming TDM update.

 

Even if the beta does not prove successful, we could leave in code support. Mappers could add their own custom light type just by including

glprogs\cubic_light.vfp in their missing pack. Preferably that would not become a widespread practice until we have a token specifically for that though.

 

81fps, khvastun :P

Good work - light working. Replacement is breaking a normal-maps and can be prblem when intersecting geometry or many source of shadow but without FPS drop. Replace with nothing only diffuse texture and normal and is z-fighting light sources. This was strange.

This is no different from before, perceptable except in quality of "ambient" lighting and spherical harmonics.

 

I much prefer this method. It looks good and as nbohr1more has spoken, it is fiddly and it will stretch lights as realism and cut-off lights in good manner that is higher quality than before.

Does not work for pointed lights. But this is no issue.

 

Big thanks for demo files!!

Have you tried lighting from underwater yet? Is necessary to create "shodow" light for water refection, as water has no specular or shadow in this mod.

 

Ya nye ponimayu why people ask for screenshot when you have given files to demo, nbhoh1more..?

Must been seen and played to appreciating difference.

 

The method. I find how to "follo" thread, but i not find how to bookmark, so will this thread be link in wiki for searching back?

Will be good to have a way to find the tread again, without leaving ball of string "Cubemap+Lighting+Beta". ok.

 

But you know... I can still push AI guard out of map by hitting when he is standing up because cosh interrupt animation and reset... Then guard falls through world.

At least world is lit well, even if guard can be beated out of reality ))))

 

I'm not sure I followed all that but the AI was just sloppily placed into the map for reference. Feel free to delete him and place another more properly. (I'm not a good mapper.)

 

Light fight is caused by alpha channel. Look no good. Can bleed outside and AI response is "blind" in "dim" area.

Can append info here? GPL render efficiency drop. Lekly due to fighting light. All the same or not.

Appendix to: http://wiki.thedarkm...title=Cube_maps ??

 

To return game to "normal", after test simply delete new files and rename *.bak (exe dll) to files original extension.

Or copy full game folder (\thedarkmod) to (\TDMbackup) then do steps, del \thedarkmod and rename \TDMbackup. Easy )

 

The AI is probably blind because he's outside the map bounds (again, poor placement). I will update the wiki once the details have been settled.


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

#37 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 22 August 2016 - 07:42 AM

My apologies.

 

I didn't get around to testing vanilla Doom 3 last night...

 

I got side-tracked after taking a second look at the vertex portion of the cubic_light.vfp.

 

For the first time I have had some success moving TDM light attributes into this shader.

 

Up to this point, I kept trying to get TDM's shader to accept the cubemap as an input, this time I've

been selectively removing and rearranging the cubic_light itself and now I'm getting actual results

rather than black screens, weird colors or blue squares all over the place.

 

Actual progress! (Now this can be a production light type rather than an effect \ curiosity!)

 

That said, I was up 'till nearly 3AM last night trying to reconcile the 3 different light behaviors (2 in cubic_light vs 1 in TDM)

and it's become painfully clear that I shouldn't proceed until I've made the new AmbientCubeLight keyword so I can

completely scrap the HL2 ambient for now and just have a workable cubemap light with TDM light attributes.


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

#38 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 539 posts

Posted 22 August 2016 - 04:20 PM

I'm not sure how this HL2 style ambient is done, but I was messing with the texgen keywords earlier and noticed something. "skybox" renders a cubemap normally. "reflect" flips it around so it appears as if it's a mirror. "wobblesky <exp> <exp> <exp>" I already know of from messing with other skybox material stages, it simulates you being on a ship or some other wobbly platform but I can't get it to work as a texgen keyword. But! My main point here! The "normal" keyword appears to just average the cubemap images into a uniform color and displays that. I've tested the cubicLights on surfaces w/o specular where I could only see the ambient, and it really does feel like it's just a cubemap that's outputting with this "normal" texgen method, just with a smooth gradient. It's all different uniform colors on different sides.

 

Might be right, might be wrong, but it feels like this is how Sikkpin might've gotten this ambient to work.


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


#39 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 22 August 2016 - 04:31 PM

What I can tell is that the shader has both directional and ambient terms. It samples the same cubemap to produce the ambient.

The sampler type needs to match up. If you use the cubemap keyword, then you must use the _nx images. If you use cameraCubemap,

you must use the _up, _right, etc images. For the HL2 ambient, the light entity must have "falloff" "0" specified.

 

That's what I've gathered thus far. I haven't played with texgen keywords but that's an interesting observation.

 

I wonder if you can use smoothnormals(<map>) on cubemaps or diffuse maps. I'll bet there some wonky color biasing at the last stage.


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

#40 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 23 August 2016 - 08:10 AM

Further misadventures of nbohr1more...

 

I got the new keyword setup and compiled. I also added branch logic for a standard vs enhanced cubic light to match our GUI setting

(Standard vs Enhanced Interaction) so now it requires 3 shaders.

 

Then I sprinted to try and get workable shaders out and screwed up my previous work. So the build will work if you copy and rename the cubic_light.vfp

to ambient_cubic_light.vfp and test_cubic_light.vfp so you have 3 identical files but I wanted to have a more complete update so I ended up

staying up too late again losing my sanity. I'll upload the compile tonight. No promises on the shaders though. I hope to get those up too though.


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

#41 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 23 August 2016 - 11:00 PM

As promised, here's my updated WIP materials:

 

https://dl.dropboxus...cLightPatch.zip

 

The ambientCubicLight currently has too much fresnel\rim lighting. Currently trying to figure out why

toning it down causes other effects in the shader. Feel free to replace the contents all vfp's with the original

until that's ironed out. The ambientCubicLight is now noShadows by default and lights backsides just like

a regular ambient. A cheater's way to fix the shadow issues to be sure but it matches the purpose there.

 

Edit:

 

The same z-fighting is happening in Doom 3. It's probably a driver bug.


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

#42 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 24 August 2016 - 01:29 PM

Will there be any before and after shots demonstrating what this fix/mod does..?



#43 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 24 August 2016 - 01:47 PM

I'll try to do that sure.

 

I was hoping for some help there as I'm not a mapper.

 

I can make conceptual screens though.

 

One simplification that will help you get started.

 

The new ambientCubicLight takes your skybox texture and uses it to create an ambient light that is based on

the color\shading of the skybox.

 

You can see in the material def in the pack that there are pairs:

 

Light

 
lights/cubecylinder
{    
    
    ambientCubicLight
    {
        // forceHighQuality
           cubeMap            env/cylinder
        colored
        zeroClamp
    }
}
 

Skybox:

textures/skies/cubecylinder
{    
    noFragment
    noshadows
    noimpact
    forceOpaque        
    qer_editorimage        env/cylinder_pz.tga
    {
        blend            add    
        cubeMap            env/cylinder
        texgen            skybox
    }
}
 

For example, I also included a light that matches the mountain sunset skybox you used in Caduceus:

 

(remember. when using images with the _up, _down, etc designations, you must use cameraCubeMap )

 
lights/mountain_sunset
{    
    ambientCubicLight

    {
        // forceHighQuality
        cameraCubeMap    env/skyboxes/skybox_mountain_sunset/mountain_sunset
        colored
        zeroClamp
    }
}
 

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

#44 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 539 posts

Posted 24 August 2016 - 03:37 PM

For the record I've tested the new version and it seems okay, though the fresnel's doing what the fresnel on our regular lights does - the bigger the light bounding box, the more diffused it is, which looks weird and sometimes wrong. It's one of the reasons why I'm holding hope that this will get looked at at some point. Still, can't really say if it will look good or bad in a real usage scenario.

 

Is the noshadows thing hardcoded or a keyword in the material files? Perhaps to aid flexibility, it could be that the lights start with shadows and it's up to the mapper to check off the box that disables them.


My FMs: The King of Diamonds (2016)

 

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


#45 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 24 August 2016 - 04:02 PM

The cubicLight keyword has shadows whilst the ambientCubicLight is hardcoded for noShadows but I believe forceShadows should still work on it if you really want.

 

Hmm, I guess I could add a program.env value to the specular or make it branch on the ARB bind (not sure which is more optimal but I know what's easier to code).


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

#46 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 24 August 2016 - 04:04 PM

Will there be any before and after shots demonstrating what this fix/mod does..?

 

I found something that better illustrates it:

 

 

Google "Unity Cookie Lights" and "Cubemap" and you'll get examples of Unity pointlights with cubemap "cookie" textures.

 

http://thomasmountainborn.com/ies/


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

#47 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 26 August 2016 - 12:56 AM

I'm getting the hang of this now...

 

darkmod_2016-08-26_01.53.46.jpg

 

Gotta stop messing with the HL2 ambient and focus on regular cubemap (unity cookie) lights though

 

updated shader. remove the txt extension and place in your glprogs directory

 

Attached File  ambient_cubic_light.vfp.txt   9.91KB   72 downloads


  • Bikerdude, 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...)

#48 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 539 posts

Posted 26 August 2016 - 04:09 AM

Indeed, the fresnel looks much better now.

 

https://dl.dropboxus...areX/cubic.webm

 

Here's a video of how different cubemaps blend when put next to each other in-game, for those who asked. It's not in a real map but it shows off how the cubic light works now well enough. The colors are just fresnel colors, there's no actual ambient lighting.


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


#49 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 26 August 2016 - 06:50 AM

I'm getting the hang of this now...

What am I looking at here?



#50 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9473 posts

Posted 26 August 2016 - 07:00 AM

What am I looking at here?


The light in the screen is colored by the skybox and the specular reflections also include skybox colors.
It's basically how HL2 does its lighting. Of course, without a system to automatically capture cubemap probes, it's a little more labor intensive than HL2 to setup.
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