WorldShadowMap oddity

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

WorldShadowMap oddity

Post by Marth8880 »

Hey guys. I'm having a strange issue with the WorldShadowMap environment effect. The issue I'm having is the shadow texture is being cast on some objects, but not all of them, or at least not the ones on which I want it to be cast. :V


No work!
Hidden/Spoiler:
Image
Image
Image
Image
The bench should be darkened from the shadow map.
Worko!
Hidden/Spoiler:
Image
Image
Image
The path model is split up into five pieces. Here are the three main pieces:
Hidden/Spoiler:
Image
Image
Image
Here is the appropriate section from my ENVFX file:

Code: Select all

Effect("WorldShadowMap")
{
	Enable(1);
	Texture("PIO_shadow_sun");
	LightName("sun");
	TextureScale(750.0); // 600.0
	AnimationFrequency(0.0);
	AnimationAmplitude0(0.0, 0.0);
	AnimationAmplitude1(0.0, 0.0);
}
And here is the shadow map texture:
Hidden/Spoiler:
Image
(Note: The upper-half of the texture is what encompasses the majority of the map.)


Merging all of the path objects into one model makes no difference. All of the path objects share the same material.

Path material settings:
Hidden/Spoiler:
Image
Why is the shadow map cast properly on some of the path objects but improperly on others? Is there any way to fix this issue?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: WorldShadowMap oddity

Post by Maveritchell »

The first thing you need to make sure you do is check to make sure your light source isn't a static light. I could definitely see that causing issues, because shadowvolumes are dynamic shadows.

Failing that, I'd have to actually experiment with your stuff to know for sure, but another quick check you can try is to flag the model's .msh.option file with "-vertexlighting." That shouldn't work (in fact, it should cause an issue with dynamic lights like this), but I've more than once been surprised by toggling that flag on or off.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: WorldShadowMap oddity

Post by Marth8880 »

Hmm. Switching the global directional "sun" light's Static option to off didn't change anything, nor did the "-vertexlighting" flag. :o

World LGT file if helpful:

Code: Select all

Light("sun", 2448186226)
{
	Rotation(0.957636, 0.287043, 0.024594, -0.002664);
	Position(-31.802378, 164.784912, -508.364746);
	Type(1);
	Color(0.501961, 0.501961, 0.501961);
	CastShadow();
	CastSpecular(1);
	PS2BlendMode(0);
	TileUV(1.000000,1.000000);
	OffsetUV(0.000000,0.000000);
}

GlobalLights()
{
	EditorGlobalDirIconSize(20);
	Light1("sun");
	Light2("");
	Top(164, 164, 164);
	Bottom(96, 96, 96);
}
Post Reply