mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 06:34:36 +00:00
Updating BaseGame to work with PBR, and a PBR example module
This commit is contained in:
parent
e83ec69292
commit
cedbd387d9
98 changed files with 6762 additions and 2889 deletions
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
|
|
@ -0,0 +1,9 @@
|
|||
<ImageAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="Grid_512_orange_ALBEDO"
|
||||
imageFile="@assetFile=Grid_512_orange.png"
|
||||
useMips="true"
|
||||
isHDRImage="false"
|
||||
originalFilePath="E:/Gamedev/T3DMIT/clangtest/Templates/Full/game/core/art/grids/Grid_512_orange.png"
|
||||
VersionId="1" />
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<ShapeAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="Cube"
|
||||
fileName="@assetFile=Cube.fbx"
|
||||
isNewShape="1"
|
||||
materialSlot0="@Asset=StaticShapeTest:Grid_512_orange"
|
||||
originalFilePath="E:/Gamedev/T3DMIT/clangtest/My Projects/T3DPreview4_0/art/StarterContent/Cube.fbx"
|
||||
VersionId="1" />
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
singleton TSShapeConstructor(CubeFbx)
|
||||
{
|
||||
baseShape = "./Cube.fbx";
|
||||
};
|
||||
BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.fbx
Normal file
BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.fbx
Normal file
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
<ShapeAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="Cylinder"
|
||||
fileName="@assetFile=Cylinder.fbx"
|
||||
isNewShape="1"
|
||||
originalFilePath="E:/Gamedev/T3DMIT/clangtest/My Projects/T3DPreview4_0/art/StarterContent/Cylinder.fbx"
|
||||
VersionId="1" />
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
singleton TSShapeConstructor(CylinderFbx)
|
||||
{
|
||||
baseShape = "./Cylinder.fbx";
|
||||
};
|
||||
BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.fbx
Normal file
BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.fbx
Normal file
Binary file not shown.
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
singleton Material(Grid_512_Orange)
|
||||
{
|
||||
mapTo = "Grid_512_orange";
|
||||
diffuseColor[0] = "0.8 0.8 0.8 1";
|
||||
diffuseMap[0] = "E:/Gamedev/T3DMIT/clangtest/Templates/Full/game/core/art/grids/Grid_512_orange.png";
|
||||
specular[0] = "0.8 0.8 0.8 1";
|
||||
specularPower[0] = "0.25";
|
||||
specularStrength[0] = "25";
|
||||
translucentBlendOp = "None";
|
||||
};
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
function StaticShapeTest::onCreate(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function StaticShapeTest::onDestroy(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<ModuleDefinition
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
ModuleId="StaticShapeTest"
|
||||
VersionId="1"
|
||||
Group="Game"
|
||||
scriptFile="StaticShapeTest.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy">
|
||||
<DeclaredAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
Extension="asset.taml"
|
||||
Recurse="true" />
|
||||
<AutoloadAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetType="ComponentAsset"
|
||||
Recurse="true" />
|
||||
<AutoloadAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetType="GUIAsset"
|
||||
Recurse="true" />
|
||||
</ModuleDefinition>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<MaterialAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="Grid_512_Orange"
|
||||
scriptFile="@assetFile=data/StaticShapeTest/materials/Grid_512_orange.cs"
|
||||
materialDefinitionName="Grid_512_Orange"
|
||||
originalFilePath="E:/Gamedev/T3DMIT/clangtest/Templates/Full/game/core/art/grids/Grid_512_orange.png"
|
||||
shaderGraph="data/StaticShapeTest/materials/Grid_512_orange.sgf"
|
||||
VersionId="1" />
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
singleton Material(Grid_512_orange) {
|
||||
mapTo = "Grid_512_orange";
|
||||
DiffuseMap[0] = "data/StaticShapeTest/Images/Grid_512_orange.png";
|
||||
DiffuseMapAsset[0] = "StaticShapeTest:Grid_512_orange_ALBEDO";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -4,17 +4,6 @@
|
|||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
|
|
@ -27,7 +16,8 @@ inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 light
|
|||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float4 screenspacePos : TEXCOORD0;
|
||||
float3 wsNormal : TEXCOORD0;
|
||||
float3 wsPosition : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -42,10 +32,17 @@ struct Fragout
|
|||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float4 rtParamslightInfoBuffer : register(C2),
|
||||
uniform SamplerState lightInfoBuffer : register(S0),
|
||||
uniform Texture2D lightInfoBufferTex : register(T0),
|
||||
uniform float visibility : register(C1)
|
||||
uniform float3 eyePosWorld : register(C17),
|
||||
uniform float4 inLightPos[3] : register(C1),
|
||||
uniform float4 inLightInvRadiusSq : register(C4),
|
||||
uniform float4 inLightColor[4] : register(C5),
|
||||
uniform float4 inLightSpotDir[3] : register(C9),
|
||||
uniform float4 inLightSpotAngle : register(C12),
|
||||
uniform float4 inLightSpotFalloff : register(C13),
|
||||
uniform float smoothness : register(C14),
|
||||
uniform float metalness : register(C15),
|
||||
uniform float4 ambient : register(C18),
|
||||
uniform float visibility : register(C16)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
|
@ -56,15 +53,13 @@ Fragout main( ConnectData IN,
|
|||
OUT.col = diffuseMaterialColor;
|
||||
|
||||
// Deferred RT Lighting
|
||||
float2 uvScene = IN.screenspacePos.xy / IN.screenspacePos.w;
|
||||
uvScene = ( uvScene + 1.0 ) / 2.0;
|
||||
uvScene.y = 1.0 - uvScene.y;
|
||||
uvScene = ( uvScene * rtParamslightInfoBuffer.zw ) + rtParamslightInfoBuffer.xy;
|
||||
float3 d_lightcolor;
|
||||
float d_NL_Att;
|
||||
float d_specular;
|
||||
lightinfoUncondition(lightInfoBufferTex.Sample(lightInfoBuffer, uvScene), d_lightcolor, d_NL_Att, d_specular);
|
||||
OUT.col *= float4(d_lightcolor, 1.0);
|
||||
IN.wsNormal = normalize( half3( IN.wsNormal ) );
|
||||
float3 wsView = normalize( eyePosWorld - IN.wsPosition );
|
||||
float4 rtShading; float4 specular;
|
||||
compute4Lights( wsView, IN.wsPosition, IN.wsNormal, float4( 1, 1, 1, 1 ),
|
||||
inLightPos, inLightInvRadiusSq, inLightColor, inLightSpotDir, inLightSpotAngle, inLightSpotFalloff, smoothness, metalness, OUT.col,
|
||||
rtShading, specular );
|
||||
OUT.col *= float4( rtShading.rgb + ambient.rgb, 1 );
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
|
|
|||
|
|
@ -4,17 +4,6 @@
|
|||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
|
|
@ -38,7 +27,8 @@ struct VertData
|
|||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float4 screenspacePos : TEXCOORD0;
|
||||
float3 wsNormal : TEXCOORD0;
|
||||
float3 outWsPosition : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -46,7 +36,8 @@ struct ConnectData
|
|||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0)
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
|
@ -57,7 +48,8 @@ ConnectData main( VertData IN,
|
|||
// Diffuse Color
|
||||
|
||||
// Deferred RT Lighting
|
||||
OUT.screenspacePos = OUT.hpos;
|
||||
OUT.wsNormal = mul( objTrans, float4( normalize( IN.normal ), 0.0 ) ).xyz;
|
||||
OUT.outWsPosition = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
|
||||
// Visibility
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,3 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Condition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline float4 autogenCondition_bde4cbab(in float3 lightColor, in float NL_att, in float specular, in float4 bufferSample)
|
||||
{
|
||||
float4 rgbLightInfoOut = float4(lightColor, 0) * NL_att + float4(bufferSample.rgb, specular);
|
||||
|
||||
return rgbLightInfoOut;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'GBuffer Conditioner' Condition Method
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
BIN
Templates/BaseGame/game/data/ui/art/BackgroundImage.png
Normal file
BIN
Templates/BaseGame/game/data/ui/art/BackgroundImage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 659 KiB |
Loading…
Add table
Add a link
Reference in a new issue