Forged Alliance Forever Forged Alliance Forever Forums 2016-03-11T17:28:31+02:00 /feed.php?f=41&t=11948 2016-03-11T17:28:31+02:00 2016-03-11T17:28:31+02:00 /viewtopic.php?t=11948&p=122525#p122525 <![CDATA[Re: Environemental Data]]>

I have enough work to do on my mod for now. I don't want to spread myself.

But latter i will give a look at theses interested fx files. I' m curious to know what we can do with them. The unit line of sight may use some shaders to put on the light on the area. Maybe we can make gradient, so it can be a sort of basic light.

Statistics: Posted by Franck — 11 Mar 2016, 17:28


]]>
2016-03-11T12:52:52+02:00 2016-03-11T12:52:52+02:00 /viewtopic.php?t=11948&p=122508#p122508 <![CDATA[Re: Environemental Data]]> Statistics: Posted by nine2 — 11 Mar 2016, 12:52


]]>
2016-03-11T12:22:45+02:00 2016-03-11T12:22:45+02:00 /viewtopic.php?t=11948&p=122504#p122504 <![CDATA[Re: Environemental Data]]> Statistics: Posted by Franck — 11 Mar 2016, 12:22


]]>
2016-03-10T23:17:54+02:00 2016-03-10T23:17:54+02:00 /viewtopic.php?t=11948&p=122435#p122435 <![CDATA[Re: Environemental Data]]> Statistics: Posted by nine2 — 10 Mar 2016, 23:17


]]>
2016-03-10T21:47:16+02:00 2016-03-10T21:47:16+02:00 /viewtopic.php?t=11948&p=122424#p122424 <![CDATA[Re: Environemental Data]]>
Le light of sun impact all objects because shaders are coded in the mesh.fx effect file

Code:
/// ComputeLight
///
/// Computes the sun's contribution to the pixel's color given the dot product
/// of the light direction and surface normal.  The dot product is precomputed
/// since other portions of the pixel shader might need it (and we need to reuse
/// as many calculations as possible.)
float3 ComputeLight( float dotLightNormal, float attenuation)
{
    /// Typical L.N calculation.
    float3 light = sunDiffuse * saturate( dotLightNormal ) * attenuation + sunAmbient;
    /// The following will "fill in" the shadow color proportional to the absence of light.
    /// This considers the absence of light due to shadows and surface normals pointing away from the light.
    /// This way all dark areas match (very cool.)
    return lightMultiplier * light + ( 1 - light ) * shadowFill;
}


Here is the unit with some code using sun light. We may code here others light contributions :

Code:
/// UnitFalloffPS
///
/// - Similar to unit shader, with the exception that it uses the diffuse texture alpha
///   channel to mask area's in which the view dependant lookup texture is sampled.
///   Only works in Medium and High fidelity.
///
float4 UnitFalloffPS( NORMALMAPPED_VERTEX vertex, uniform bool hiDefShadows) : COLOR0
{
    if ( 1 == mirrored ) clip(vertex.depth.x);

    float3x3 rotationMatrix = float3x3( vertex.binormal, vertex.tangent, vertex.normal);
    float3 normal = ComputeNormal( normalsSampler, vertex.texcoord0.zw, rotationMatrix);
    float dotLightNormal = dot(sunDirection,normal);
   
    float4 diffuse = tex2D( albedoSampler, vertex.texcoord0.xy);
    float4 specular = tex2D( specularSampler, vertex.texcoord0.xy);
   float3 environment = texCUBE( environmentSampler, reflect( -vertex.viewDirection, normal));
   
   // Calculate lookup into falloff ramp
   float NdotV = pow(1 - saturate(dot( normalize(vertex.viewDirection), normal )), 0.6);
   float4 fallOff = tex2D( falloffSampler, float2(NdotV,vertex.material.x));
   
   // Calculate specular highlights based on current sun direction
    float3 reflection = reflect( sunDirection, normal);
    float specularAmount = saturate( dot( reflection, -vertex.viewDirection));
   float3 phongAdditive = float3 (0.5,0.6,0.7) * pow( specularAmount, 9) * specular.g;
   
   // Calculate environment map reflection
    environment *= specular.r * fallOff.a;
   
   // Calculate lighting and shadows
    float shadow = 0; // ComputeShadow( vertex.shadow, hiDefShadows);
   
    float3 light = sunDiffuse * saturate( dotLightNormal ) * shadow + sunAmbient;
    light = light + ( 1 - light ) * shadowFill;
   
   // Determine our final output color
   float3 color = diffuse.rgb * light;
   color += environment + phongAdditive;                     
   color += (fallOff.rgb * diffuse.a);                              
   
   float alpha = mirrored ? 0.5 : specular.b + glowMinimum;
   return float4( color, alpha );
}


I think we can adding some code to the fx file to add some diffuse light around from any shader effect. I do not have the skill in coding shaders to do that, but i think, it's possible, and it must add a incredible stunning refresh in the 3D engine.

Ok, we may loose some fps, but supcom has been coded before 2007, some we have a bunch amount of graphic power that can be use today.

I'm on with any project that need a financial contribution to hire a professional programmer that may add this stuff (i think this student has the skill to add this feature : http://gamedevelopment.tutsplus.com/tut ... -cms-24351)

Or maybe with some practice : http://gamedevelopment.tutsplus.com/tutorials/a-beginners-guide-to-coding-graphics-shaders--cms-23313

Statistics: Posted by Franck — 10 Mar 2016, 21:47


]]>
2016-03-10T19:14:43+02:00 2016-03-10T19:14:43+02:00 /viewtopic.php?t=11948&p=122408#p122408 <![CDATA[Re: Environemental Data]]> Statistics: Posted by Lionhardt — 10 Mar 2016, 19:14


]]>
2016-03-09T11:05:09+02:00 2016-03-09T11:05:09+02:00 /viewtopic.php?t=11948&p=122266#p122266 <![CDATA[Re: Environemental Data]]>
A big amount a fog of war in a low powered sun with a bubble shader effect around the ACU :

http://hpics.li/104ce99

But sadly lights from shaders around the ACU do not reflect around in the environnement. So we cannot create artificials lightning for better visual... hum just light can change everything as i do in this simple speed test under Unreal Engine 4 :

http://hpics.li/3bd2390

Statistics: Posted by Franck — 09 Mar 2016, 11:05


]]>
2016-03-08T13:07:19+02:00 2016-03-08T13:07:19+02:00 /viewtopic.php?t=11948&p=122147#p122147 <![CDATA[Re: Environemental Data]]> Statistics: Posted by Franck — 08 Mar 2016, 13:07


]]>
2016-03-08T12:57:38+02:00 2016-03-08T12:57:38+02:00 /viewtopic.php?t=11948&p=122146#p122146 <![CDATA[Re: Environemental Data]]> Statistics: Posted by speed2 — 08 Mar 2016, 12:57


]]>
2016-03-08T12:51:51+02:00 2016-03-08T12:51:51+02:00 /viewtopic.php?t=11948&p=122142#p122142 <![CDATA[Re: Environemental Data]]> Statistics: Posted by nine2 — 08 Mar 2016, 12:51


]]>
2016-03-08T10:09:45+02:00 2016-03-08T10:09:45+02:00 /viewtopic.php?t=11948&p=122140#p122140 <![CDATA[Environemental Data]]>
I wanna know if we can control on the supcom engine somme environemental data such as sun light power and rotation, wind, global frog... ?

I'm currently adding some lights on units and building, and i think it may be much more visually attractive with lower powered sun light.

Any idea ?

Statistics: Posted by Franck — 08 Mar 2016, 10:09


]]>