Jump to content
The Dark Mod Forums

Tracker 3881: Cubemap Lighting Beta


nbohr1more

Recommended Posts

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

Link to comment
Share on other sites

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.

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.thedarkmod.com/index.php?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
Link to comment
Share on other sites

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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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.thedarkmod.com/index.php?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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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.

  • 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

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.

  • 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

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.

  • 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

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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

As promised, here's my updated WIP materials:

 

https://dl.dropboxusercontent.com/u/17706561/cubicLightPatch.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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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!

 

 

Link to comment
Share on other sites

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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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.com/mods/the-dark-mod

 

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

Link to comment
Share on other sites

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

 

post-3763-0-01556000-1472191005_thumb.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

 

ambient_cubic_light.vfp.txt

  • 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

Indeed, the fresnel looks much better now.

 

https://dl.dropboxusercontent.com/u/655334/ShareX/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.

  • 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

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

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

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...