Jump to content
The Dark Mod Forums

Light baking


Bikerdude

Recommended Posts

Not quite; a shadow texture. Not a light texture with a shadow.

 

The candles casted both light and shadows on the ground and the ceiling. This is placing a shadow only, and is not connected to any light.

 

For the candles, you could also have two projected lights, one for light and one for shadow, or you could have a light texture and a shadow like the one I'm using here, but then that ends up using two lights for every candle, so there's a resource and performance tradeoff to be considered. Anyway, we should try to keep discussion for that in the candle thread, I suppose.

Link to comment
Share on other sites

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

Okay here's a quick shot of a room with soft shadows by faking it with blendLight shadow textures.

 

-make the furniture noshadows 1

-create a blendLight light entity and adjust it manually (there's an entity rotation bug or two in DR that can make this tricky)

-target them with an extinguishable light and they'll toggle with it

 

That's it. Didn't upload the map because I have a custom square texture which isn't currently on SVN, used for the couch and table. But it's all pretty straight forward, but can take a few mins per light to get correct. Will need to make a wedge too. With circles, wedges, squares, rotated and sized light entities, this is another method to achieve the 'light bake' look.

 

 

 

 

 

Obviously there are limitations:

-self shadows are still sharp (mostly minor)

-mixing 'dynamic' items (a moveable, an AI) with fixed items (couch) can be touchy; should be used when appropriate

Link to comment
Share on other sites

What happens if the player takes out his lantern or takes any other dynamic light source to this room?

 

I fear you are simply reversing the "always dynamic shadows" property of the D3 engine and revert back to "light maps", except in a hacky way. So you end up with the worst of bot worlds.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Ermmm... Ihavetosay,yesIagree.

 

An awful lot of this "making it work for weakerthans" stuff seems very much a mess being made. The whole point of dynamic shadows is that they are a terrific progressive step forward in gaming.

"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

Link to comment
Share on other sites

For outdoor environments with static lighting this would enhance performance and allow for more polygons.

 

Yes, ideally all lighting would be dynamic but how many current FM's have tons of lights set to noshadow to make them playable?

 

The shaped ambient that Rich_is_Bored demonstrated would be the least intrusive as you could bake just illumination bounces for a richer look but still use projected dynamic lights for direct lighting without too much interference.

Edited by nbohr1more

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

Yeah, I'm afraid I don't think it looks that great. Sure soft shadows would be nice but you lose the whole dynamic shadow thing.

 

It's like a step backwards to T2. The couch gets that floating look.

 

And not to mention the work, it goes from placing a couch to minutes of back and forth in game to make sure the shadow is properly placed, only to have a moving light source completely break the illusion.

over the course of an entire map thats tons of work.

 

 

However I can see this being a great way to darken in corners, maybe better than decals everywhere.

 

You really shouldn't have to make all your lights noshadow to get decent performance in any map. But it is PART of optimizing so it needs to be done accordingly.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Surprise, a couple of tech demos thrown together quickly to demonstrate didn't win some over. :rolleyes:

 

Only three objects in the scene are noshadow; the light still casts. With the lantern it looks fine. An AI shadow standing right over it causes some incongruence. But to repeat, it was thrown together without interest in taking all day to make a simple point. It could be made to look much better of course, and more tuned to this mixed approach.

 

Well, one bonus about it is you don't have to use the techniques. They're there if you want or need it for a particular scene. If you don't want to mix stencil and soft, dynamic and lightmap, you're going to have to wait for light engine modifications, and thus wait for the source. Hope.

 

Or... try merging in that D3 soft shadows mod.

Link to comment
Share on other sites

If it worked with Projected Lights it would be like a precomputed shadow volume and thus virtually the same as a real dynamic shadow but less performance hit because the volume wouldn't need to be calculated on the fly (definitely better than a decal)... Plus, if I understand "GL minus one" correctly then the effect should be cancelled by direct lighting? The weird thing would be to see the soft-shadow turn to a hard shadow when it moves in response to the light...

 

(Edit: If you wanted it to match the look of the dynamic shadows but still reap the performance benefits you would simply make sure the shadow texture has a hard edge...)

 

I looks like it does work with projected shadows... we'd just need the correct definition file:

 

http://www.doom3worl...&st=0&sk=t&sd=a

 


lights/bdog_testBlendLight2
{
blendLight
lightFalloffImage makeintensity( textures/blackdog/blendlight_falloff_inverse.tga )
{
blend gl_zero, gl_one_minus_src_color
map textures/blackdog/blackdog_icon_inverse.tga
zeroclamp
//alphazeroclamp
colored
} 
}

Edited by nbohr1more

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

Surprise, a couple of tech demos thrown together quickly to demonstrate didn't win some over. rolleyes.gif

 

Only three objects in the scene are noshadow; the light still casts. With the lantern it looks fine. An AI shadow standing right over it causes some incongruence. But to repeat, it was thrown together without interest in taking all day to make a simple point. It could be made to look much better of course, and more tuned to this mixed approach.

 

Well, one bonus about it is you don't have to use the techniques. They're there if you want or need it for a particular scene. If you don't want to mix stencil and soft, dynamic and lightmap, you're going to have to wait for light engine modifications, and thus wait for the source. Hope.

 

Or... try merging in that D3 soft shadows mod.

 

 

Don't get me wrong, I'm not dissing it or your effort looking into it. And it's never bad having more options and more things looked into to improve performance/looks. But you solidified my point about taking too much time. You said it took several minutes to place shadows for 3 objects, and then say it needs to be more finely tuned... = needs more time.

 

Still, there are places where I think I'd still use this. For shadows behind objects against a wall would be a great place, A big dresser or something could have a soft shadow behind it and look good as not much detail would ever hit the wall anyway, and it would save performance too.

But things with legs it's just too obvious imo and does make them 'float'.

 

Curious though, Does that shadow hit the table itself (or the inside of a cabinet against a wall to get a proper large shadow) or only terrain.

 

I've just already excepted that even though hard stencils don't look as good as soft shadows it's still an improvement over soft static shadows.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

No worries, it's not my personal method or anything. :) Just that the last several posts all said they didn't like it. Okay, guess it's not for everyone.

 

For shadows behind objects against a wall would be a great place...big dresser or something could have a soft shadow behind it and look good

Yup I'm sure this will make for decent AO simulation, and other subtle effects. Not in the forefront, having to stand up to realtime stencil scrutiny, but in the background, adding a touch to the scene to make it look better. I think that nightblade bedroom shot really got to me. :laugh: (Now that I look at it again, it's pretty over-done IMO. Still pretty though, and it like it. For the record, I guess pretty much all of that could be done in TDM as well. But not dynamic. Is it dynamic in NB, or baked? I don't know the tech even.)

 

Curious though, Does that shadow hit the table itself (or the inside of a cabinet against a wall to get a proper large shadow) or only terrain.

I kept it low to the ground so it wouldn't darken the couch or table. The chair one was the hardest to place because of a light rotation bug in DR (that I mean to look up and/or report).

Link to comment
Share on other sites

I think that nightblade bedroom shot really got to me. :laugh: (Now that I look at it again, it's pretty over-done IMO. Still pretty though, and it like it. For the record, I guess pretty much all of that could be done in TDM as well.

I'd imagine it could be done in TDM, but if the shadows aren't properly affected by dynamic light then you'd want to save this technique for certain areas.

 

One thing that stands out in that bedroom screen is the oil lantern on the wall. Glass objects in TDM (like the laboratory flask) appear transparent, whereas that oil lantern appears more translucent. I'm sure that they employed some trick to make it look so good (have a look at the reflection of the light on the right side), I'd love to see something like that in TDM.

Edited by Midnight
Link to comment
Share on other sites

If it worked with Projected Lights it would be like a precomputed shadow volume and thus virtually the same as a real dynamic shadow but less performance hit because the volume wouldn't need to be calculated on the fly (definitely better than a decal)... Plus, if I understand "GL minus one" correctly then the effect should be cancelled by direct lighting? The weird thing would be to see the soft-shadow turn to a hard shadow when it moves in response to the light...

 

(Edit: If you wanted it to match the look of the dynamic shadows but still reap the performance benefits you would simply make sure the shadow texture has a hard edge...)

 

I looks like it does work with projected shadows... we'd just need the correct definition file:

 

http://www.doom3worl...l...&st=0&sk=t& sd=a

 


lights/bdog_testBlendLight2
{
blendLight
lightFalloffImage makeintensity( textures/blackdog/blendlight_falloff_inverse.tga )
{
blend gl_zero, gl_one_minus_src_color
map textures/blackdog/blackdog_icon_inverse.tga
zeroclamp
//alphazeroclamp
colored
} 
}

 

Yeah...? I don't think the native TDM blendLight example can do projected negative light volumes because it does not have an inverse falloffImage as the example above?

 


lights/shadows/shadow_circle_01
{
blendLight
qer_editorimage lights/shadows/shadow_circle_01_ed.jpg

{
	blend 		blend
	forceHighQuality
	map 			lights/shadows/shadow_circle_01
	clamp
}
}

Edited by nbohr1more

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

Yup I'm sure this will make for decent AO simulation, and other subtle effects. Not in the forefront, having to stand up to realtime stencil scrutiny, but in the background, adding a touch to the scene to make it look better.

I never knew Doom 3 was capable of this shadow casting technique. It is perfect for AO simulation and I hope it will eventually replace the grime decals, which always end up being way too dark and pulling out the lantern on them does have little effect either. So the alternative is highly welcome and should be communicated to the mappers in my opinion. A clever, flexible system of these shadowcast textures should be created to allow for quick AO placement e.g. in a whole room.

Link to comment
Share on other sites

Huh. Well there ya go then. So we can fake-a-bake, and have your dynamic cake too.

 

Really? Each dynamic (e.g. just on/off) light needs two light/shadow textures - one for when it is on, and when it is off. We can probably get away with one (when it is on) and turn the shadow map off when it is off. But you can forget moving the light, tho.

 

Also, look at the screenshot you posted, the candle on the table doesn't cast any shadows at all...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I'm not sure how to take these last few posts from you, but they sound like they're aiming to call down two optional means of providing ambient occlusion or soft shadow to a scene simply because they have limitations. A mapper needs to recognize the limitations and work within them.

 

For example,

 

* Don't put AO or soft shadow on a moveable box.

 

* Do put them on and around a big ominous statue which darkens a room with its size and otherwise looks poor with a single razor sharp stencil shadow jiggling behind it.

Link to comment
Share on other sites

I never said more options are bad, but I think that these soft-shadows have only very limited use (e.g. when both the object and the light for it are static and no new lights can come into play).

 

And the basic problems of these baked-shadows are *exactly* what D3 overcame with the always-dynamic shadows. If you try to introduce them, you are moving backwards in time, and in the end will create something like "The Witcher", where you have beatiful soft-shadows combined with horrible dynamic razor-shadows, and a scene which is neither dynamic (it can't be, pre-baked shadows) nor correct (either it is missing dynamic shadows, or they look even more wrong (because contrast sharply with softshadows).

 

Think about it:

 

You have a large statue, and some big light behind it. The statue has "noshadows" (otherwise it casts a stencil shadow), and the shadow is soft and baked.

 

Now the player enters with a light. The statue will NOT cast a shadow from the lantern (the whole "noshadows thing).

 

Alternatively, the statue casts shadows, but the soft-shadow light doesn't cast a shadow. So the player enters, brings a box and the box doesn't cast a shadow from the wall-light..

 

It is simple impossible to have it both ways, you either have dynamic shadows, or you don't.

 

(That is the reason why our candle holders switch their noshadows based on wether the light is on or off, because the self-shadow look ugly).

 

Anyway, I don''t want to downplay things, because there are ways I can see this enhance the scene (as a low-light modulation, basically AO), but it will simply not work right replacing the dynamic shadows of an object (unless we patch the engine to draw dynamic shadows only from certain lights and supress them from others).

 

And as a personal note, I think players would rather see a working v1.03 than a new way to painstakingly add soft-shadows for each object in the map. The time-waste alone just to achieve the effect makes me cringe...

 

Edit: Just in case this came out too negative, things like "pre-baked light from moonlightbars" etc. can really bring out a scene - and currently things like the light filtering through a window or skylight don't cast shadows anyway, so this might work. However, doing it manually is so 1990 - every other toolchain has gone to automatically baking lights, so I am not sure we really want to do this manually. But that opens up another box of goo :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

My take on it:

 

Mapping with existing (on svn already) soft shadow lights (they're in the /shadows folder) doesn't take away from progress on 1.03. It's not stopping anyone else from plowing ahead at lightning speed while I work on a map for 15 minutes. And if someone doesn't want me to spend that 15 minutes of my free time doing that, I believe that's tough freakin' noogies. :wub: Heck, I've spent more time replying to these posts than I did in the map.

 

Every time a mapper marks an entity noshadows 1 it's basically flipping the same bird to dynamic lighting. "Real life" contains both soft and sharp shadows, depending on the light source and scene.

 

Anyway, I'm not the salesman for this. Just trying it out. Use it, or don't.

 

Based on your opinion(s), I strongly recommend you don't. :laugh:

Link to comment
Share on other sites

There's a time and place for each of these tricks. If the author of an FM shows no regard for the limitations and drawbacks associated with each, the feedback they receive should reflect that and the map's popularity will suffer as a result. Problem solved.

 

Personally, my interest in this isn't soft shadows. I couldn't care less about that. I'm more interested in simulating light bounces.

Link to comment
Share on other sites

And as a personal note, I think players would rather see a working v1.03 than a new way to painstakingly add soft-shadows for each object in the map. The time-waste alone just to achieve the effect makes me cringe...

 

Oh that's rich. :rolleyes:

Link to comment
Share on other sites

In spite of it's limited utility I have worked out what I believe is the definition syntax to convert a regular projected light to a "negative" projected light:

 


lights/shadows/shadow_circle_projected_01
{
	map 	invertcolor(lights/shadows/Example_Pre_Existing_Falloff.
tga)
	}
{
blendLight
lightFalloffImage makeintensity( lights/shadows/Example_Pre_Existing_Falloff.
tga )
{
blend gl_zero, gl_one_minus_src_color
map lights/shadows/shadow_circle_01
zeroclamp
//alphazeroclamp
colored
} 
}

 

(Presuming the Doom3world example was using a similar z-projection image, otherwise... another invertcolor stage?)

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

Really? Each dynamic (e.g. just on/off) light needs two light/shadow textures - one for when it is on, and when it is off. We can probably get away with one (when it is on) and turn the shadow map off when it is off. But you can forget moving the light, tho.

 

Also, look at the screenshot you posted, the candle on the table doesn't cast any shadows at all...

 

The concerns about integrating additional an additional framework to accommodate this method should be nil if I understand the existing light scripting system. If one light-switch can control multiple light sources then both the positive and negative lights can be deactivated at once, no?

(edit, AFAIK this is just assigning multiple targets?)

 

I agree that for indoor scenes this should be very limited as this is a break from the intended use of the engine. I presume that the major utility of these effects is for out-door areas where static lights are already being used heavily.

 

I do see, however, that a scripted event that changes the light to a dynamic shadowed light when an AI is near would be very cumbersome. If that's the concern then, yes it's a waste of resources to setup that system.

 

Again, the shaped ambient "Strombine" technique should have merit in either scenario as long as the bounces aren't directly derived from dynamic lighting but instead whatever static ambient scenario the mapper decides on (window light, occluded corners, moonlight, magic glow) but artistic consistency is still a concern here (anything can look bad in the right hands...).

Edited by nbohr1more

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • 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
       
      · 3 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
×
×
  • Create New...