View Issue Details

IDProjectCategoryView StatusLast Update
0003776The Dark ModDef / Setuppublic17.08.2017 13:54
ReporterSpringheel Assigned ToSpringheel  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.06 
Summary0003776: Add soft shadows to light entities
DescriptionAlready added to new light entities; there are several existing ones that could benefit from this, especially the movable candles. However, there is a problem:

Adding the following lines to atdm:moveable_candle_base_sp should be attaching the shadow to the origin of either the candle or the base, but it's not. It is attaching the shadow to the same location as the flame, and strangely, changing the "attach_pos_origin" values does not appear to move the shadow at all.
"def_attach_3" "light_candle_circle01"
"attach_pos_origin_3" "0 0 -10"
TagsNo tags attached.
Attached Files
badshadow.map (5,747 bytes)   
Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "61.2462 39.9297 115.126"
"editor_drLastCameraAngle" "15.9 15.9 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -264 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 1 0 -128 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.8125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -320 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.8125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.8125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.8125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 256 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -256 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 1 0 -136 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -320 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 0 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 0 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 128 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -256 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 255.6875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 1 0 -128 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -328 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0.3125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 0 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 320 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 1 0 -128 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.1875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -320 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.1875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 -8 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.1875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.1875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 1 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -256 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -320 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 0 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 -8 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 0 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 1 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -256 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0.3125 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 1 0 -128 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 255.6875 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 0 ) ( ( 0.0390625 0 0.3125 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 -8 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
// primitive 6
{
brushDef3
{
( 0 1 0 -128 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 7.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 1 0 0 -320 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 7.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 -1 128 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 -1 0 0 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 7.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( -1 0 0 192 ) ( ( 0.0390625 0 255.6875 ) ( 0 0.0390625 7.5 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
( 0 0 1 -136 ) ( ( 0.0390625 0 0 ) ( 0 0.0390625 0 ) ) "textures/darkmod/fabric/cloth_coarse_cream_dirty" 0 0 0
}
}
}
// entity 1
{
"classname" "atdm:lamp_oil_standing_copper_lit"
"name" "atdm_lamp_oil_standing_copper_lit_1"
"origin" "232 64 136"
}
// entity 2
{
"classname" "atdm:ambient_world"
"name" "ambient_world"
"origin" "168 64 136"
"light_center" "0 0 0"
"light_radius" "320 320 320"
"_color" "0.08 0.08 0.08"
}
// entity 3
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "64 64 0"
"angle" "1"
}
badshadow.map (5,747 bytes)   

Relationships

has duplicate 0003758 closedSpringheel Attach projected shadows to light entities 

Activities

nbohr1more

nbohr1more

14.07.2014 19:11

developer   ~0006719

Sounds like something in the code is enforcing that all "lights" attach to the same place (even blendlights)? Or to inherit the "light_center" value from each other?

Actually, this isn't such a bad attach point since that's technically where a real shadow would originate (though it make shadow asset creation a little more of a hassle... you would need a falloff image that masks the shaft of the candle so it doesn't self-shadow, ugh...).
Springheel

Springheel

14.07.2014 19:18

administrator   ~0006720

I can work with it attaching to the "flame" point (though I don't see anything telling it to attach there) but I can't seem to move it with the traditional attach_pos spawnargs.
nbohr1more

nbohr1more

14.07.2014 19:23

developer   ~0006721

can you move it with the light_center spawnarg?
Springheel

Springheel

22.07.2014 02:41

administrator   ~0006775

The light_center spawnarg doesn't seem to have any effect on blendlights (or at least the shadow ones).
SteveL

SteveL

22.07.2014 07:30

reporter   ~0006778

Messed with it a bit this morning, and managed to get it to work correctly but I had to use the "attach_pos_origin" spawnargs in combination with the "attach_pos_name" spawnargs.

Here are the spawnargs from my map file:
{
   "classname" "atdm:brazier_post01"
   "name" "brazier_adjusted"
   "origin" "120 42 0.0504203"

   "attach_pos_name_1" "flame"
   "attach_pos_origin_1" "0 0 82"

   "attach_pos_name_2" "shadowflame"
   "attach_pos_origin_2" "0 0 10"

   "def_attach" "light_cageflame_small"
   "pos_attach" "flame"

   "def_attach2" "light_cross_shadow"
   "pos_attach2" "shadowflame"
}

NB when I did this to the post brazier, the shadow vanished! Maybe it's not reaching the ground or something? But I confirmed that its origin was 10 units above the post's origin in the debugger. Where the original entity def is used, the shadowlight origin is at the post's origin (and shows up ok in game).
Springheel

Springheel

22.07.2014 13:19

administrator   ~0006780

Attaching it to static entities works fine...I just can't seem to do it with movable candles.
SteveL

SteveL

22.07.2014 16:21

reporter   ~0006790

Can you give me an entityDef? I'll spawn it with the game running in the debugger, one line of code per keypress. That sometimes makes it obvious what's up (other time not, but no harm trying!).
Springheel

Springheel

02.09.2014 00:56

administrator   ~0006927

Last edited: 02.09.2014 00:58

Try this:
////////////////////
entityDef atdm:moveable_candle_base_sp
{
    "inherit" "atdm:moveable_small_base"

    "editor_usage" "Don't use, base class for all Springheel's unlit moveable candles."
    "editor_displayFolder" "Lights/Model Lights, Movable/Candles/DoNotUse"
    "equippable" "1"
    // upon using the candle when carrying it around, extinguish our bound flames and switch skin
    "equip_action_script" "frob_light_holder_ext"

    "skin_unlit" "tdm_candle_a_unlit"
    "skin_lit" "tdm_candle_a_lit"
    "skin" "tdm_candle_a_unlit"

    "noshadows_lit" "1" // turn off shadow when lit
    "noshadows" "0" // unlit, so it has shadows
    "extinguished" "1"

    // attach the non-light, so the candle can be lit by fire stims
    "def_attach" "light_candleflame_unlit_sp"
    "pos_attach" "flame_sp" // At the attach point called "flame"...
    "attach_pos_name_1" "flame_sp" // ... which is defined here.
    "name_attach" "flame" // Set a name to pass along spawnargs
    "attach_pos_origin_1" "0 0 0" // Offset the flame X units in the Z direction

    "snd_bounce" "tdm_impact_tiny"
    "bouncyness" "0.02"
    "friction" "0.1"
    "scriptobject" "tdm_light_holder"
    
    "def_attach3" "light_candle_circle01"
    "pos_attach3" "shadow"
        "attach_pos_name3" "shadow"
        "attach_pos_origin3" "0 0 20" // shadow attached, but position not doing anything??
}////////////////////

You should then be able to add any candle to see the issue.
It's the def_attach3 lines that add the shadow. It should be appearing beneath the candle but instead it is centered on the flame. Changing attach_pos_origin3 doesn't appear to do anything.

Springheel

Springheel

02.09.2014 00:59

administrator   ~0006928

Last edited: 02.09.2014 01:01

Wait a sec...it's not something as silly as a missing underscore in attach_pos_name is it...? Testing....

edit: Oh bloody hell, that was it.

Springheel

Springheel

04.09.2014 21:04

administrator   ~0006937

Ok, movable candle holders now have this. Wide candles and lanterns are also good candidates.
Springheel

Springheel

21.11.2014 20:34

administrator   ~0007156

Most movable entities larger than a single candle now have these. The rest can wait until 2.04.
Springheel

Springheel

04.03.2015 14:42

administrator   ~0007451

I'm going to suspend this until soft shadows are working. Once that's in place, we might find that we can enable regular shadows on movable lights.
SteveL

SteveL

05.03.2015 18:45

reporter   ~0007452

Last edited: 05.03.2015 18:45

I had the same thought. The effect we're trying out will provide hardening of the shadow on contact which will look great when a candle is being put down. Pity that people generally pick candles up only to pinch them out, but I guess we can't change that :)

grayman

grayman

07.03.2015 00:33

viewer   ~0007453

atdm:lamp_oil_standing_copper_lit shows a shadow cross on the ceiling below.

There might be other lights painting the same thing.

Test map attached.

Issue History

Date Modified Username Field Change
14.07.2014 18:52 Springheel New Issue
14.07.2014 18:52 Springheel Status new => assigned
14.07.2014 18:52 Springheel Assigned To => Springheel
14.07.2014 19:11 nbohr1more Note Added: 0006719
14.07.2014 19:18 Springheel Note Added: 0006720
14.07.2014 19:19 Springheel Relationship added has duplicate 0003758
14.07.2014 19:23 nbohr1more Note Added: 0006721
22.07.2014 02:41 Springheel Note Added: 0006775
22.07.2014 07:30 SteveL Note Added: 0006778
22.07.2014 13:19 Springheel Note Added: 0006780
22.07.2014 16:21 SteveL Note Added: 0006790
02.09.2014 00:56 Springheel Note Added: 0006927
02.09.2014 00:58 Springheel Note Edited: 0006927
02.09.2014 00:59 Springheel Note Added: 0006928
02.09.2014 01:01 Springheel Note Edited: 0006928
04.09.2014 21:04 Springheel Note Added: 0006937
21.11.2014 20:34 Springheel Note Added: 0007156
21.11.2014 20:34 Springheel Target Version TDM 2.03 =>
21.11.2014 20:37 Springheel Target Version => TDM 2.04
04.03.2015 14:42 Springheel Note Added: 0007451
04.03.2015 14:42 Springheel Status assigned => suspended
05.03.2015 18:45 SteveL Note Added: 0007452
05.03.2015 18:45 SteveL Note Edited: 0007452
07.03.2015 00:32 grayman File Added: badshadow.map
07.03.2015 00:33 grayman Note Added: 0007453
08.01.2016 21:34 Springheel Target Version TDM 2.04 => TDM 2.05
25.11.2016 14:02 grayman Product Version => SVN
25.11.2016 14:02 grayman Target Version TDM 2.05 => TDM 2.06
17.08.2017 13:54 Springheel Status suspended => closed
17.08.2017 13:54 Springheel Resolution open => fixed