MacOS platform support.

This commit is contained in:
RexTimmy 2016-09-28 11:09:48 +10:00
parent 57dfeb829a
commit dd64004eaf
89 changed files with 1228 additions and 5098 deletions

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>torqueDemo</string>
<key>CFBundleIdentifier</key>
<string>com.garagegames.${EXECUTABLE_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>GG3d</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>mainMenu</string>
<key>NSPrincipalClass</key>
<string>macApplication</string>
</dict>
</plist>

View file

@ -0,0 +1 @@
/procedural/

View file

@ -31,8 +31,6 @@ in vec4 mieColor;
#define IN_mieColor mieColor
in vec3 v3Direction;
#define IN_v3Direction v3Direction
in float zPosition;
#define IN_zPosition zPosition
in vec3 pos;
#define IN_pos pos
@ -65,12 +63,6 @@ void main()
float fac = dot( normalize( pos ), sunDir );
fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
OUT_col = mix( color, nightSkyColor, nightInterpAndExposure.y );
// Clip based on the camera-relative
// z position of the vertex, passed through
// from the vertex position.
if(zPosition < 0.0)
discard;
OUT_col.a = 1;

View file

@ -47,8 +47,6 @@ out vec4 mieColor;
#define OUT_mieColor mieColor
out vec3 v3Direction;
#define OUT_v3Direction v3Direction
out float zPosition;
#define OUT_zPosition zPosition
out vec3 pos;
#define OUT_pos pos

View file

@ -47,8 +47,8 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
colorBuffer *= (1.0 - colorBuffer.a);
}
colorBuffer *= float4(lightBuffer.rgb, 1.0);
colorBuffer += float4(specular, specular, specular, 1.0);
colorBuffer *= float4(lightBuffer.rgb, 1.0);
return hdrEncode( float4(colorBuffer.rgb, 1.0) );
}

View file

@ -21,13 +21,13 @@
//-----------------------------------------------------------------------------
#include "../../../gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
in vec2 uv0;
uniform sampler2D colorBufferTex;
out vec4 OUT_FragColor0;
void main()
{
OUT_FragColor0 = vec4(texture( colorBufferTex, uv0 ).rgb, 1.0);
{
OUT_FragColor0 = vec4(texture( colorBufferTex, uv0 ).rgb, 1.0);
}

View file

@ -33,4 +33,4 @@ void main()
{
float depth = prepassUncondition( prepassTex, uv0 ).w;
OUT_col = vec4( texture( depthViz, depth ).rgb, 1.0 );
}
}

View file

@ -21,14 +21,13 @@
//-----------------------------------------------------------------------------
#include "../../../gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
#include "../../../postFx/gl/postFX.glsl"
in vec2 uv0;
uniform sampler2D glowBuffer;
out vec4 OUT_FragColor0;
void main()
{
{
OUT_FragColor0 = texture(glowBuffer, uv0);
}

View file

@ -21,7 +21,6 @@
//-----------------------------------------------------------------------------
#include "../../../gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
in vec2 uv0;
uniform sampler2D lightPrePassTex;
@ -29,7 +28,7 @@ uniform sampler2D lightPrePassTex;
out vec4 OUT_col;
void main()
{
{
vec4 lightColor = texture( lightPrePassTex, uv0 );
OUT_col = vec4( lightColor.rgb, 1.0 );
}
OUT_col = vec4( lightColor.rgb, 1.0 );
}

View file

@ -21,7 +21,6 @@
//-----------------------------------------------------------------------------
#include "../../../gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
in vec2 uv0;
uniform sampler2D lightPrePassTex;
@ -29,7 +28,7 @@ uniform sampler2D lightPrePassTex;
out vec4 OUT_col;
void main()
{
{
float specular = texture( lightPrePassTex, uv0 ).a;
OUT_col = vec4( specular, specular, specular, 1.0 );
}
}

View file

@ -20,14 +20,14 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../../../gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
in vec2 uv0;
uniform sampler2D matinfoTex;
out vec4 OUT_FragColor0;
void main()
{
{
float specular = texture( matinfoTex, uv0 ).a;
OUT_FragColor0 = vec4( specular, specular, specular, 1.0 );
}

View file

@ -52,8 +52,8 @@ void main()
colorBuffer *= (1.0 - colorBuffer.a);
}
colorBuffer *= vec4(lightBuffer.rgb, 1.0);
colorBuffer += vec4(specular, specular, specular, 1.0);
colorBuffer *= vec4(lightBuffer.rgb, 1.0);
OUT_col = hdrEncode( vec4(colorBuffer.rgb, 1.0) );
}

View file

@ -147,6 +147,17 @@ void main()
return;
}
vec4 colorSample = texture( colorBuffer, uvScene );
vec3 subsurface = vec3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = vec3(0.772549, 0.337255, 0.262745);
else
subsurface = vec3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
vec4 prepassSample = prepassUncondition( prePassBuffer, uvScene );
vec3 normal = prepassSample.rgb;
@ -258,6 +269,5 @@ void main()
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
}
vec4 colorSample = texture( colorBuffer, uvScene );
OUT_col = AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
OUT_col = AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -89,6 +89,17 @@ void main()
return;
}
vec4 colorSample = texture( colorBuffer, uvScene );
vec3 subsurface = vec3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = vec3(0.772549, 0.337255, 0.262745);
else
subsurface = vec3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
vec4 prepassSample = prepassUncondition( prePassBuffer, uvScene );
vec3 normal = prepassSample.rgb;
@ -195,6 +206,5 @@ void main()
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
}
vec4 colorSample = texture( colorBuffer, uvScene );
OUT_col = AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
OUT_col = AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -202,6 +202,17 @@ void main()
return;
}
vec4 colorSample = texture( colorBuffer, uv0 );
vec3 subsurface = vec3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = vec3(0.772549, 0.337255, 0.262745);
else
subsurface = vec3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
vec4 prepassSample = prepassUncondition( prePassBuffer, uv0 );
vec3 normal = prepassSample.rgb;
@ -312,6 +323,5 @@ void main()
lightColorOut = debugColor;
#endif
vec4 colorSample = texture( colorBuffer, uv0 );
OUT_col = AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
OUT_col = AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -149,6 +149,16 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
{
return float4(0.0, 0.0, 0.0, 0.0);
}
float4 colorSample = TORQUE_TEX2D( colorBuffer, uvScene );
float3 subsurface = float3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = float3(0.772549, 0.337255, 0.262745);
else
subsurface = float3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
float4 prepassSample = TORQUE_PREPASS_UNCONDITION( prePassBuffer, uvScene );
@ -263,6 +273,5 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
}
float4 colorSample = TORQUE_TEX2D( colorBuffer, uvScene );
return AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -87,6 +87,17 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
return float4(0.0, 0.0, 0.0, 0.0);
}
float4 colorSample = TORQUE_TEX2D( colorBuffer, uvScene );
float3 subsurface = float3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = float3(0.772549, 0.337255, 0.262745);
else
subsurface = float3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
float4 prepassSample = TORQUE_PREPASS_UNCONDITION( prePassBuffer, uvScene );
float3 normal = prepassSample.rgb;
@ -194,6 +205,5 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
}
float4 colorSample = TORQUE_TEX2D( colorBuffer, uvScene );
return AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -202,6 +202,16 @@ float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
return float4(1.0, 1.0, 1.0, 0.0);
}
float4 colorSample = TORQUE_TEX2D( colorBuffer, IN.uv0 );
float3 subsurface = float3(0.0,0.0,0.0);
if (getFlag( matInfo.r, 1 ))
{
subsurface = colorSample.rgb;
if (colorSample.r>colorSample.g)
subsurface = float3(0.772549, 0.337255, 0.262745);
else
subsurface = float3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
float4 prepassSample = TORQUE_PREPASS_UNCONDITION( prePassBuffer, IN.uv0 );
float3 normal = prepassSample.rgb;
@ -314,6 +324,5 @@ float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
lightColorOut = debugColor;
#endif
float4 colorSample = TORQUE_TEX2D( colorBuffer, IN.uv0 );
return AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
}

View file

@ -43,5 +43,5 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
fogData.y,
fogData.z );
return hdrEncode( float4( fogColor.rgb, 1.0 - saturate( factor ) ) );
return hdrEncode( float4( toLinear(fogColor.rgb), 1.0 - saturate( factor ) ) );
}

View file

@ -48,5 +48,5 @@ void main()
fogData.y,
fogData.z );
OUT_col = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) );
OUT_col = hdrEncode( vec4( toLinear(fogColor.rgb), 1.0 - saturate( factor ) ) );
}