Jump to content
The Dark Mod Forums

Lamps without shadows


sparhawk

Recommended Posts

A single light with a light texture would be ideal in cases where it can be used, but again, I'm not sure how this setup would work for the wall lamps. Unlike streetlights which can use a light that only points downwards, the lamp needs to illuminate the wall and the ceiling without a shadow, but project a shadow on the floor and lower wall. Using an omnidirectional light with a shadow texture would (AFAIK) run into the "stick of rock" problem, whereby the shadow would be extruded vertically up the wall and onto the ceiling, not just projected onto the floor.

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

A decal or blendlight would make it possible to control the fake shadow independently of the light sources volume.

That would be much easier to manage than a projected light texture on the source which would change with volume adjustments.

Link to comment
Share on other sites

So what is the conclusion? I don't really want to add an extra workloadprior to the release

 

If mappers want to do this kind of stuff they can...the functionality already exists to deal with this in multiple ways, including using decals that already exist. And the lamps in that shot already HAVE a shadow...Jdude turned them off on purpose for performance reasons. There's certainly nothing here that needs to be addressed before 1.0.

Link to comment
Share on other sites

A single light with a light texture would be ideal in cases where it can be used, but again, I'm not sure how this setup would work for the wall lamps. Unlike streetlights which can use a light that only points downwards, the lamp needs to illuminate the wall and the ceiling without a shadow, but project a shadow on the floor and lower wall. Using an omnidirectional light with a shadow texture would (AFAIK) run into the "stick of rock" problem, whereby the shadow would be extruded vertically up the wall and onto the ceiling, not just projected onto the floor.

 

I don't think it needs to be to complicated. If there is a dark blob on the wall, that would already make it look more realistic. It doesn't really need to be a well defined shadow even.

Gerhard

Link to comment
Share on other sites

From an artistic point of view, if you want to use these for a faked lamp you'd have them tied to the lamp so when it shuts off, so will the shadow to prevent the shadow from sticking around after the light is off.

 

This is why decals can't be used for such, you'd see the decal shadow after it was turned off still.

Link to comment
Share on other sites

Depends how well-defined the shadow is. You might be able to get away with a blend filter (multiplicative) decal with an indistinct blob shape. When the light goes off, the immediate area will darken due to the lack of light; so the effect of the decal won't be as noticeable, and the remaining shadow might be attributed to the effect of other lights (including ambient light). If there are no other lights in the area at all, then everything is pitch black and you can't see the decal anyway. :P

 

It may not work in all situations, of course. That's where mapper discretion comes in.

 

Talking is useless, someone try it and post screenshots already. :laugh:

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

You should be able to turn off the decal by making it a func_static and targetting it from an extinguishable flame or electric switch. By default func_statics hide/show when targetted. I do this with the halo I've been using. (Dark Radiant nicely re-targets this when cloning.)

Link to comment
Share on other sites

  • 3 weeks later...

I'm in a new WIP map; It's pretty well-lit in the outdoors areas, and I've got some tall cliffs and stonework in some pretty high-elevated areas. (Think of the US Grand Canyon nearing dusk)

 

I'd like these to cast rather large, but soft-edged shadows on the ground and surrounding area. How should I go about doing this? I'm proficient enough in the GIMP to make my own decals (blobs, random noise, whatever I might need for artwork), but I don't know enough about Doom 3 rendering to give them code support.

 

If soft shadows aren't feasible in this situation, should I just tediously position lights instead of trying to blend shadows to the landscape?

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

triggers and scripts, my friend!

 

// greebo: Allows scripts to set a named lightgem modifier to a certain value (e.g. "lantern" => 32)

const idEventDef EV_Player_SetLightgemModifier("setLightgemModifier", "sd");

 

Oh, yes: I'm going to create some soft-edged shadow decals where sunlight passes through the leaves of trees.

 

Edit:

It saddens me that decals aren't nearly as easy as HL2 mapping was. Decals would just follow the curve of displacements FOR you. Oh well...

 

post-2515-1240259496_thumb.png(Yes, I know the lighting is high noon: the parallel light just doesn't like me)

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

This is in tdm_events.script about setLightgemModifier.

 

 /**
 * greebo: Sets the named lightgem modifier to a certain value. An example would be the
 *		 player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers
 *		 can be set by concurrent script threads.
 */
scriptEvent void	setLightgemModifier(string modifierName, float value);

 

How would you be able to use this to simulate a shadow volume not being drawn by the renderer? Something with a trigger and a map script?

Link to comment
Share on other sites

It saddens me that decals aren't nearly as easy as HL2 mapping was. Decals would just follow the curve of displacements FOR you. Oh well...

 

If you use a blend light instead of decals, this is exactly what will happen.

 

Just create your shadow decal as a light texture, use a blend light in "blend filter" mode, and position it where you want the shadow.

Link to comment
Share on other sites

:angry: Sigh, I'm getting the big 'missing texture' black box in-game. I suspect it has something to do with my definition. I just set this as the texture of a regular omni OR projected light entity, yeah?

 

lights/shadows/shadow_circle_01
{
qer_editorimage lights/shadows/shadow_circle_01_ed
noShadows
blendLight
{
forceHighQuality
map lights/shadows/shadow_circle_01
zeroClamp
}
}

 

I swear, if this ever works, I'll make a tutorial for the wiki.

edit: removing .tga extension still didn't solve it

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Try removing the ".tga" from your material-name.

And yes you just choose the material in your light-properties, the type of light doesn't matter, it will just do the projection differently depending on the type of light.

Link to comment
Share on other sites

A couple of observations about that definition:

 

1. If you want the blend light to only cast a shadow, and not add illumination, you must use "blend filter" or "blend modulate" in the texture stage.

 

2. Are you putting the image in lights/shadows or textures/lights/shadows in the filesystem? It seems some definitions are using one and others the other, which could cause confusion. I guess your image must be in lights/ not textures/lights based on the definition.

Link to comment
Share on other sites

Well, I've been poking it with a monkey stick and it still refuses to work correctly. I still suspect that it's my definition. Do you think you could post a sample blend filter definition for me to work with? (include details like "I placed the texture in darkmod/textures/lights/shadows") I'm just a physics guy, I know so little about the renderer.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

From an artistic point of view, if you want to use these for a faked lamp you'd have them tied to the lamp so when it shuts off, so will the shadow to prevent the shadow from sticking around after the light is off.

 

This is why decals can't be used for such, you'd see the decal shadow after it was turned off still.

 

My plan was to simply modify the "noshadows" variable when the light goes on/off (only when another spawnarg, like "nolitselfshadow" is true).

 

That would mean that unlit-candles cast a shadow, but not when they are lit.

 

Basically a compromise between the "no shadows ever, it looks unrealistic" we have now, and the "always a shadow, looks bad because the candle causes a big shadow when lit on the table below".

 

However, I never got arund to do that. sorry :(

"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've gotten it to work. There is only one problem: It wants to draw black outside the light volume. I understand why it's culling outside, but not why it's all black. (Edit: I was using zeroClamp instead of clamp. Oops. :blush: )

 

GOOD NEWS: the lightgem is properly affected by the blend light.

 

post-2515-1240866712_thumb.jpg

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Have you tried making the shadows move (with the translate keyword)? Could be a cool effect.

Do you have an idea what to do against the texture tiling?

Well, moving shadows would make a neat prefab. I could give it a shot, moving it with an osscilator?

 

Texture tiling is taken care of in the texture definition. "Clamp" just makes everything outside the texture bounds transparent. It's the same Clamp that keeps our blood stains from tiling

yay seuss crease touss dome in ouss nose tair

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