Compare commits

..

3 Commits

4 changed files with 30 additions and 20 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[submodule "assets"] [submodule "assets"]
path = assets path = assets
url = tacticalz@1.drake.imon.nu:TacticalZ-assets url = https://imon.nu/git/BTH/Axyz-assets.git
[submodule "deps"] [submodule "deps"]
path = deps path = deps
url = tacticalz@1.drake.imon.nu:TacticalZ-deps url = https://imon.nu/git/BTH/Axyz-deps.git
+20 -2
View File
@@ -31,13 +31,22 @@
<Components> <Components>
<c:Animation> <c:Animation>
<AnimationName>ActivateShieldU</AnimationName> <AnimationName>ActivateShieldU</AnimationName>
<Play>true</Play>
<Loop>false</Loop> <Loop>false</Loop>
</c:Animation> </c:Animation>
<c:Transform/> <c:Transform/>
</Components> </Components>
<Children/> <Children/>
</Entity> </Entity>
<Entity name="Idle">
<Components>
<c:Animation>
<AnimationName>ShieldFrontU</AnimationName>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children> </Children>
</Entity> </Entity>
<Entity name="Front"> <Entity name="Front">
@@ -65,7 +74,16 @@
<Components> <Components>
<c:Animation> <c:Animation>
<AnimationName>ActivateShieldU</AnimationName> <AnimationName>ActivateShieldU</AnimationName>
<Play>true</Play> <Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Idle">
<Components>
<c:Animation>
<AnimationName>ShieldFrontU</AnimationName>
<Loop>false</Loop> <Loop>false</Loop>
</c:Animation> </c:Animation>
<c:Transform/> <c:Transform/>
+5 -6
View File
@@ -321,7 +321,8 @@ void main()
float shadowFactor = 0.0; float shadowFactor = 0.0;
for(int i = start; i < start + amount; i++) { for(int i = start; i < start + amount; i++) {
vec3 shadowColor = vec3(1.0);
int l = int(LightIndex[i]); int l = int(LightIndex[i]);
LightSource light = LightSources.List[l]; LightSource light = LightSources.List[l];
@@ -333,13 +334,11 @@ void main()
int DepthMapIndex = getShadowIndex(FarDistance); int DepthMapIndex = getShadowIndex(FarDistance);
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal); light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
shadowFactor = CalcShadowValue(Input.PositionLightSpace[DepthMapIndex], Input.Normal, vec3(light.Direction), DepthMap, DepthMapIndex); shadowFactor = CalcShadowValue(Input.PositionLightSpace[DepthMapIndex], Input.Normal, vec3(light.Direction), DepthMap, DepthMapIndex);
shadowColor = min(vec3(shadowFactor), vec3(1.0));
} }
totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao, light_result.Diffuse.a); totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao * shadowColor, light_result.Diffuse.a);
totalLighting.Specular += vec4(light_result.Specular.rgb * ao, light_result.Specular.a); totalLighting.Specular += vec4(light_result.Specular.rgb * ao * shadowColor, light_result.Specular.a);
} }
totalLighting.Diffuse *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
totalLighting.Specular *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed); vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
@@ -160,9 +160,9 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf
} }
} }
SpawnerSystem::Spawn(attachment, attachment); if (IsServer) {
SpawnerSystem::Spawn(attachment, attachment);
/* }
EntityWrapper backAttachment = attachment.FirstChildByName("Back"); EntityWrapper backAttachment = attachment.FirstChildByName("Back");
if (backAttachment.Valid()) { if (backAttachment.Valid()) {
@@ -172,11 +172,7 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf
eDeployShieldAttachement.Restart = true; eDeployShieldAttachement.Restart = true;
eDeployShieldAttachement.Start = true; eDeployShieldAttachement.Start = true;
m_EventBroker->Publish(eDeployShieldAttachement); m_EventBroker->Publish(eDeployShieldAttachement);
} else {
LOG_ERROR("back shield invalid");
} }
EntityWrapper frontAttachment = attachment.FirstChildByName("Front"); EntityWrapper frontAttachment = attachment.FirstChildByName("Front");
if (frontAttachment.Valid()) { if (frontAttachment.Valid()) {
Events::AutoAnimationBlend eDeployShieldAttachement; Events::AutoAnimationBlend eDeployShieldAttachement;
@@ -186,10 +182,7 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf
eDeployShieldAttachement.Start = true; eDeployShieldAttachement.Start = true;
m_EventBroker->Publish(eDeployShieldAttachement); m_EventBroker->Publish(eDeployShieldAttachement);
} else {
LOG_ERROR("front shield invalid");
} }
*/
if (IsClient) { if (IsClient) {
EntityWrapper root = wi.FirstPersonEntity; EntityWrapper root = wi.FirstPersonEntity;