Torque3D/Templates/BaseGame/game/data/shaders/common/hlslStructs.h
Areloch 1ed8b05169 Initial implementation of the new Base Game Template and some starting modules.
This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded.

Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect.

This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
2017-02-24 02:40:56 -06:00

116 lines
No EOL
3.5 KiB
C

//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// The purpose of this file is to get all of our HLSL structures into one place.
// Please use the structures here instead of redefining input and output structures
// in each shader file. If structures are added, please adhere to the naming convention.
//------------------------------------------------------------------------------
// Vertex Input Structures
//
// These structures map to FVFs/Vertex Declarations in Torque. See gfxStructs.h
//------------------------------------------------------------------------------
// Notes
//
// Position should be specified as a float4. Right now our vertex structures in
// the engine output float3s for position. This does NOT mean that the POSITION
// binding should be float3, because it will assign 0 to the w coordinate, which
// results in the vertex not getting translated when it is transformed.
struct VertexIn_P
{
float4 pos : POSITION;
};
struct VertexIn_PT
{
float4 pos : POSITION;
float2 uv0 : TEXCOORD0;
};
struct VertexIn_PTTT
{
float4 pos : POSITION;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
};
struct VertexIn_PC
{
float4 pos : POSITION;
float4 color : DIFFUSE;
};
struct VertexIn_PNC
{
float4 pos : POSITION;
float3 normal : NORMAL;
float4 color : DIFFUSE;
};
struct VertexIn_PCT
{
float4 pos : POSITION;
float4 color : DIFFUSE;
float2 uv0 : TEXCOORD0;
};
struct VertexIn_PN
{
float4 pos : POSITION;
float3 normal : NORMAL;
};
struct VertexIn_PNT
{
float4 pos : POSITION;
float3 normal : NORMAL;
float2 uv0 : TEXCOORD0;
};
struct VertexIn_PNTT
{
float4 pos : POSITION;
float3 normal : NORMAL;
float3 tangent : TANGENT;
float2 uv0 : TEXCOORD0;
};
struct VertexIn_PNCT
{
float4 pos : POSITION;
float3 normal : NORMAL;
float4 color : DIFFUSE;
float2 uv0 : TEXCOORD0;
};
struct VertexIn_PNTTTB
{
float4 pos : POSITION;
float3 normal : NORMAL;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float3 T : TEXCOORD2;
float3 B : TEXCOORD3;
};