Compare commits

..

2 Commits

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