[WIN] Chess Titans - XInput ve Shader Kodları

NESDelisi

Game Maker
TC Onaylı
Süper Mod.
chess-titans.jpg

Chess Titans oyununda neler varmış göz attım? Bulduğum şeyler aslında oyun içinde olan sırlardır diyebilirim.

Kısaca​

Bu oyun Windows Vista ve 7 ile birlikte gelmektedir.


XInput Modu​

Eğer bilgisayara bir XBOX kolu takılırsa oyun o kolu tanıyacaktır.


Tuşlar;
  • Left analog stick/D-Pad/Shoulder Buttons/Triggers: Fare imlecini hareket ettirir. Menü içinde geçerlidir.
  • B/Back: Önceki adıma geri gider.
  • A/X: İmleçle nesne seçiliyken basılırsa onu alır ve oynamak istediğin alana götür ve yeniden bas. Bu klavyedeki boşluk tuşuna eşdeğerdir.
  • Y/Start: Oyunun menüsünü tetikler.

Shader Kodları​

Oyunun chess.dll dosyasını açmayı başarırsanız içerisinde 12B9358 değerinden itibaren okuyabileceksiniz.

Kodlar;

float4x4 World;
float4x4 View;
float4x4 Projection;
texture DecalTexture;
texture GradientTexture;


sampler2D DecalSampler = sampler_state
{
Texture = (DecalTexture);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};


sampler2D DecalSamplerQuick = sampler_state
{
Texture = (DecalTexture);
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
AddressU = Clamp;
AddressV = Clamp;
};


sampler1D GradientSampler = sampler_state
{
Texture = (GradientTexture);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = None; // oh dear god. don't use mips because it'll sample from the lowest mip level when a triangle as the same texture coords for all 3 verts
AddressU = Clamp;
};


sampler2D ScreenSampler = sampler_state
{
Texture = (DecalTexture);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};


sampler2D ScreenSamplerPoint = sampler_state
{
Texture = (DecalTexture);
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
AddressU = Clamp;
AddressV = Clamp;
};


technique TWorldDecal
{
pass P0
{
WorldTransform[0] = (World);
ViewTransform = (View);
ProjectionTransform = (Projection);

Lighting = false;
ZEnable = false;
ZFunc = LessEqual;
ZWriteEnable = false;

AlphaBlendEnable = true;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

Sampler[0] = (DecalSampler);
Sampler[1] = (GradientSampler);

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
ColorOp[1] = SelectArg2;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[2] = Disable;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Current;
AlphaOp[1] = Modulate;
AlphaArg1[1] = Texture;
AlphaArg2[1] = Current;
AlphaOp[2] = Disable;

VertexShader = null;
PixelShader = null;
}
}


technique TWorldDecalQuick
{
pass P0
{
WorldTransform[0] = (World);
ViewTransform = (View);
ProjectionTransform = (Projection);

Lighting = false;
ZEnable = false;
ZFunc = LessEqual;
ZWriteEnable = false;

AlphaBlendEnable = true;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

Sampler[0] = (DecalSamplerQuick);

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
ColorOp[1] = Disable;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Current;
AlphaOp[1] = Disable;

VertexShader = null;
PixelShader = null;
}
}


technique TScreenDecal
{
pass P0
{
WorldTransform[0] = (World);
ViewTransform = (World);
ProjectionTransform = (World);

Lighting = false;
ZEnable = false;
ZFunc = Always;
ZWriteEnable = true;

AlphaBlendEnable = true;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

Sampler[0] = (ScreenSampler);
Sampler[1] = (GradientSampler);

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
ColorOp[1] = SelectArg2;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[2] = Disable;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Current;
AlphaOp[1] = Modulate;
AlphaArg1[1] = Texture;
AlphaArg2[1] = Current;
AlphaOp[2] = Disable;

VertexShader = null;
PixelShader = null;
}
}


technique TScreenDecalPoint
{
pass P0
{
WorldTransform[0] = (World);
ViewTransform = (World);
ProjectionTransform = (World);

Lighting = false;
ZEnable = false;
ZFunc = Always;
ZWriteEnable = true;

AlphaBlendEnable = true;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

Sampler[0] = (ScreenSamplerPoint);
Sampler[1] = (GradientSampler);

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
ColorOp[1] = SelectArg2;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[2] = Disable;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Current;
AlphaOp[1] = Modulate;
AlphaArg1[1] = Texture;
AlphaArg2[1] = Current;
AlphaOp[2] = Disable;

VertexShader = null;
PixelShader = null;
}
}


technique TScreenDecalImmediate
{
pass P0
{
WorldTransform[0] = (World);
ViewTransform = (World);
ProjectionTransform = (World);

Lighting = false;
ZEnable = false;
ZFunc = Always;
ZWriteEnable = true;

AlphaBlendEnable = true;
SrcBlend = One;
DestBlend = InvSrcAlpha;

Sampler[0] = (ScreenSampler);
Sampler[1] = (GradientSampler);

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
ColorOp[1] = SelectArg2;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[1] = Disable;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Current;
AlphaOp[1] = Modulate;
AlphaArg1[1] = Texture;
AlphaArg2[1] = Current;
AlphaOp[1] = Disable;

VertexShader = null;
PixelShader = null;
}
}
float4x4 WorldViewProjection;
float4x4 WorldView;
float4x4 World;
float4x4 View;
float4x4 ViewInv;
float4x4 Projection;
texture AlbedoTexture;
texture ReflTexture;
texture EnvTexture;
float Alpha;


float EnvironmentContribution = 0.25;
float ReflectionStrength = 0.25;
float TrimReflectionStrength = 0.45;


//-----------------------------------------------------------------------------
sampler2D AlbedoSampler = sampler_state
{
Texture = (AlbedoTexture);
float3 kaWhite = float3( 0.260, 0.260, 0.290 );
float3 kdWhite = float3( 0.820, 0.820, 0.850 );
float reflWhite = 0.33;

float3 kaBlack = float3( 0.200, 0.200, 0.200 );
float3 kdBlack = float3( 0.450, 0.450, 0.450 );
float reflBlack = 0.14;

float environmentTextureAmount = 0.6;

float3 worldLight = float3( 0.259, 0.966, 0 ); // 15 degrees over
float3 trimColor = float3( 0.600, 0.580, 0.500 );


bool pieceAlbedo = true;
#define COLOROP0 Modulate


#include "Media\Shaders\MeshCommon.fx"
float3 kaWhite = float3( 0.317, 0.317, 0.317 );
float3 kdWhite = float3( 0.651, 0.651, 0.651 );
float reflWhite = 0.08;

float3 kaBlack = float3( 0.035, 0.045, 0.055 );
float3 kdBlack = float3( 0.165, 0.165, 0.165 );
float reflBlack = 0.17;

float environmentTextureAmount = 1.0;

float3 worldLight = float3( 0.259, 0.966, 0 ); // 15 degrees over
float3 trimColor = float3( 0.600, 0.580, 0.500 );


bool pieceAlbedo = false;
#define COLOROP0 SelectArg2


#include "Media\Shaders\MeshCommon.fx"
float3 kaWhite = float3( 0.317, 0.317, 0.317 );
float3 kdWhite = float3( 0.800, 0.800, 0.800 );
float reflWhite = 0.10;

float3 kaBlack = float3( 0.320, 0.250, 0.220 );
float3 kdBlack = float3( 1.000, 1.000, 1.000 );
float reflBlack = 0.14;

float environmentTextureAmount = 1.0;

float3 worldLight = float3( 0.259, 0.966, 0 ); // 15 degrees over
float3 trimColor = float3( 0.600, 0.580, 0.500 );


bool pieceAlbedo = true;
#define COLOROP0 Modulate


#include "Media\Shaders\MeshCommon.fx"
float4x4 WorldViewProjInv;
texture SkyBoxTexture;


samplerCUBE SkyBoxSampler = sampler_state
{
Texture = (SkyBoxTexture);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};


struct VS_OUTPUT
{
float4 Position : POSITION;
float3 TexCoord : TEXCOORD0;
};


VS_OUTPUT SkyBoxVS( float4 Pos : POSITION )
{
VS_OUTPUT Output;

Output.Position = Pos;
Output.TexCoord = normalize( mul( Pos, WorldViewProjInv ) );

return Output;
}


float4 SkyBoxPS( VS_OUTPUT Input ) : COLOR
{
float3 c = texCUBE( SkyBoxSampler, Input.TexCoord );
return float4( c, 1 );
}


technique TSkyBox
{
pass P0
{
ZEnable = false;
AlphaBlendEnable = false;

VertexShader = compile vs_1_1 SkyBoxVS();
PixelShader = compile ps_1_1 SkyBoxPS();
}
}

Kaynakça;
1: https://tcrf.net/Chess_Titans