Updating BaseGame to work with PBR, and a PBR example module

This commit is contained in:
Areloch 2019-05-08 01:27:51 -05:00
parent 82881f0875
commit 9ac9c13fea
139 changed files with 7640 additions and 2889 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -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" />

View file

@ -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" />

View file

@ -0,0 +1,5 @@
singleton TSShapeConstructor(CubeFbx)
{
baseShape = "./Cube.fbx";
};

View file

@ -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" />

View file

@ -0,0 +1,5 @@
singleton TSShapeConstructor(CylinderFbx)
{
baseShape = "./Cylinder.fbx";
};

View file

@ -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";
};

View file

@ -0,0 +1,10 @@
function StaticShapeTest::onCreate(%this)
{
}
function StaticShapeTest::onDestroy(%this)
{
}

View file

@ -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>

View file

@ -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" />

View file

@ -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 ---

Binary file not shown.

View file

@ -0,0 +1,32 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
singleton CubemapData( HdrSkyCubemap )
{
cubeMap = "./hdrSky.dds";
};
singleton Material( HdrSky )
{
cubemap = HdrSkyCubemap;
materialTag0 = "Skies";
};

View file

@ -0,0 +1 @@
These texture files were created by FreePBR.com and may be used freely in your video games and 3d work at no cost. They may not however be redistributed on other websites or anywhere else other than FreePBR.com. We think that is more than fair. :) We also would greatly appreciate it if some sorrt of credit was given if you do indeed use these textures in a published game. Other than that, keep on creating and have fun. :)

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

View file

@ -0,0 +1,8 @@
<LevelAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="PbrMatTestLevel"
LevelFile="PbrMatTest.mis"
LevelName="PBR Mat Test"
LevelDescription="A scene that demonstrates various PBR materials"
VersionId="1" />

View file

@ -0,0 +1,382 @@
//--- OBJECT WRITE BEGIN ---
new Scene(PBRMatTestLevel) {
canSave = "1";
canSaveDynamicFields = "1";
cdTrack = "2";
CTF_scoreLimit = "5";
enabled = "1";
musicTrack = "lush";
new LevelInfo(theLevelInfo) {
nearClip = "0.1";
visibleDistance = "1000";
visibleGhostDistance = "0";
decalBias = "0.0015";
fogColor = "0.6 0.6 0.7 1";
fogDensity = "0";
fogDensityOffset = "700";
fogAtmosphereHeight = "0";
canvasClearColor = "0 0 0 255";
ambientLightBlendPhase = "1";
ambientLightBlendCurve = "0 0 -1 -1";
soundAmbience = "AudioAmbienceDefault";
soundDistanceModel = "Linear";
canSave = "1";
canSaveDynamicFields = "1";
desc0 = "PBR Mat Test";
enabled = "1";
levelName = "A PBR Mat test";
};
new SkyBox(theSky) {
Material = "HdrSky";
drawBottom = "1";
fogBandHeight = "0";
position = "-10.0787 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new Sun(theSun) {
azimuth = "15";
elevation = "160";
color = "1 1 1 1";
ambient = "0 0 0 1";
brightness = "2";
castShadows = "1";
staticRefreshFreq = "250";
dynamicRefreshFreq = "8";
coronaEnabled = "1";
coronaMaterial = "Corona_Mat";
coronaScale = "0.5";
coronaTint = "1 1 1 1";
coronaUseLightColor = "1";
flareType = "SunFlareExample";
flareScale = "1";
attenuationRatio = "0 1 1";
shadowType = "PSSM";
texSize = "1024";
overDarkFactor = "2000 1000 500 100";
shadowDistance = "400";
shadowSoftness = "0.15";
numSplits = "4";
logWeight = "0.91";
fadeStartDistance = "0";
lastSplitTerrainOnly = "0";
representedInLightmap = "0";
shadowDarkenColor = "0 0 0 -1";
includeLightmappedGeometryInShadow = "0";
position = "4.38005 139.658 -22.3993";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
direction = "1 1 -1";
};
new SimGroup(PlayerDropPoints) {
canSave = "1";
canSaveDynamicFields = "1";
enabled = "1";
new SpawnSphere() {
autoSpawn = "0";
spawnTransform = "0";
radius = "0.5";
sphereWeight = "1";
indoorWeight = "1";
outdoorWeight = "1";
isAIControlled = "0";
dataBlock = "SpawnSphereMarker";
position = "-9.39606 10.3721 3.14272";
rotation = "0 0 -1 90.6035";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
enabled = "1";
homingCount = "0";
lockCount = "0";
};
};
new Skylight(theSkyLight) {
enabled = "1";
ReflectionMode = "Baked Cubemap";
position = "8.74661 10.1457 2.94337";
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
persistentId = "247d7009-db8a-11e8-87b8-ed691a78e155";
posOffset = "0 0 0";
ProbeShape = "Box";
radius = "10";
reflectionPath = "levels/Timmy Test/probes/";
scale = "1 1 1";
};
new TSStatic() {
shapeName = "art/shapes/material_ball/material_ball.dae";
skin = "iron";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-14.1145 15.7844 2.76337";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic() {
shapeName = "art/shapes/material_ball/material_ball.dae";
skin = "plastic";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-16.3895 15.7844 2.76337";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic() {
shapeName = "art/shapes/material_ball/material_ball.dae";
skin = "gold";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-11.9028 15.7844 2.76337";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic() {
shapeName = "art/shapes/material_ball/material_ball.dae";
skin = "greasy";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-9.71689 15.7844 2.76337";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic() {
shapeName = "art/shapes/material_ball/material_ball.dae";
skin = "copper";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-7.6275 15.7844 2.76337";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic(floor) {
shapeName = "art/shapes/floor/floor.dae";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Visible Mesh";
DecalType = "Visible Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-11.7037 15.245 1.7387";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new TSStatic() {
shapeName = "art/shapes/sphere/sphere.dae";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
CollisionType = "Collision Mesh";
DecalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
position = "-10.15 -3.23709 3.47759";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new SpotLight() {
range = "10";
innerAngle = "5";
outerAngle = "45";
isEnabled = "1";
color = "1 0 0 1";
brightness = "1";
castShadows = "1";
staticRefreshFreq = "32";
dynamicRefreshFreq = "8";
priority = "1";
animate = "1";
animationType = "SpinLightAnim";
animationPeriod = "5";
animationPhase = "1";
flareScale = "1";
attenuationRatio = "0 1 1";
shadowType = "Spot";
texSize = "512";
overDarkFactor = "2000 1000 500 100";
shadowDistance = "400";
shadowSoftness = "0.15";
numSplits = "1";
logWeight = "0.91";
fadeStartDistance = "0";
lastSplitTerrainOnly = "0";
representedInLightmap = "0";
shadowDarkenColor = "0 0 0 -1";
includeLightmappedGeometryInShadow = "0";
position = "-11.3397 10.2393 5.48993";
rotation = "0.996932 0.0250098 -0.0741721 37.3757";
canSave = "1";
canSaveDynamicFields = "1";
};
new PointLight() {
radius = "10";
isEnabled = "1";
color = "0.011612 1 0.991102 1";
brightness = "1";
castShadows = "1";
staticRefreshFreq = "32";
dynamicRefreshFreq = "8";
priority = "1";
animate = "1";
animationType = "SubtlePulseLightAnim";
animationPeriod = "1";
animationPhase = "1";
flareScale = "1";
attenuationRatio = "0 1 1";
shadowType = "DualParaboloidSinglePass";
texSize = "512";
overDarkFactor = "2000 1000 500 100";
shadowDistance = "400";
shadowSoftness = "0.15";
numSplits = "1";
logWeight = "0.91";
fadeStartDistance = "0";
lastSplitTerrainOnly = "0";
representedInLightmap = "0";
shadowDarkenColor = "0 0 0 -1";
includeLightmappedGeometryInShadow = "0";
position = "-9.67408 18.3499 3.91894";
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
};
new ConvexShape() {
Material = "Grid512_Blue_Mat";
position = "-6.41329 13.7734 2.12278";
rotation = "0 0 1 3.19212";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
surface = "0 0 0 1 0 0 0.384079";
surface = "0 1 0 0 0 0 -0.384079";
surface = "0.707107 0 0 0.707107 0 0.285194 0";
surface = "0 0.707107 -0.707107 0 0 -0.285194 -1.42109e-14";
surface = "0.5 0.5 -0.5 0.5 -0.758333 0 -1.07696e-07";
surface = "0.5 -0.5 0.5 0.5 0.758333 0 -1.07696e-07";
};
new BoxEnvironmentProbe() {
enabled = "0";
refOffset = "0 0 0";
refScale = "10 10 10";
ReflectionMode = "Baked Cubemap";
position = "-11.7544 15.2634 4.67576";
rotation = "1 0 0 0";
scale = "10 10 10";
canSave = "1";
canSaveDynamicFields = "1";
persistentId = "8c7e1f23-5f1c-11e9-8089-c88cdaba85a3";
attenuation = "1";
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,91 @@
singleton Material(Mat_base_material_ball)
{
mapTo = "base_material_ball";
diffuseColor[0] = "1 1 1 1";
smoothness[0] = "1";
metalness[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};
singleton Material(Mat_gold_material_ball)
{
mapTo = "gold_material_ball";
diffuseMap[0] = "data/pbr/images/gold_albedo.png";
normalMap[0] = "data/pbr/images/gold_normal.png";
roughMap[0] = "data/pbr/images/gold_roughness.png";
metalMap[0] = "data/pbr/images/gold_metallic.png";
invertSmoothness[0] = "1";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};
singleton Material(Mat_plastic_material_ball)
{
mapTo = "plastic_material_ball";
diffuseMap[0] = "data/pbr/images/plastic_A.dds";
normalMap[0] = "data/pbr/images/plastic_N.dds";
roughMap[0] = "data/pbr/images/plastic_roughness.png";
aoMap[0] = "data/pbr/images/ao.png";
metalMap[0] = "data/pbr/images/plastic_metallic.png";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
invertSmoothness[0] = "1";
materialTag0 = "pbr";
};
singleton Material(Mat_iron_material_ball)
{
mapTo = "iron_material_ball";
diffuseMap[0] = "data/pbr/images/rustediron_albedo.png";
normalMap[0] = "data/pbr/images/rustediron_normal.png";
roughMap[0] = "data/pbr/images/rustediron_roughness.png";
aoMap[0] = "data/pbr/images/rustediron_ao.png";
metalMap[0] = "data/pbr/images/rustediron_metallic.png";
invertSmoothness[0] = "1";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};
singleton Material(Mat_greasy_material_ball)
{
mapTo = "greasy_material_ball";
diffuseMap[0] = "data/pbr/images/greasy-pan-2-albedo.png";
normalMap[0] = "data/pbr/images/greasy-pan-2-normal.png";
roughMap[0] = "data/pbr/images/greasy-pan-2-roughness.png";
metalMap[0] = "data/pbr/images/greasy-pan-2-metal.png";
invertSmoothness[0] = "1";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};
singleton Material(Mat_copper_material_ball)
{
mapTo = "copper_material_ball";
diffuseMap[0] = "data/pbr/images/oxidized-copper-albedo.png";
normalMap[0] = "data/pbr/images/oxidized-copper-normal-ue.png";
roughMap[0] = "data/pbr/images/oxidized-coppper-roughness.png";
metalMap[0] = "data/pbr/images/oxidized-copper-metal.png";
invertSmoothness[0] = "1";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};
singleton Material(Floor_Material)
{
mapTo = "floor_mat";
diffuseMap[0] = "data/pbr/images/FloorEbony_basecolor.png";
normalMap[0] = "data/pbr/images/FloorEbony_normal.png";
roughMap[0] = "data/pbr/images/FloorEbony_rough.png";
aoMap[0] = "data/pbr/images/FloorEbony_ao.png";
metalMap[0] = "data/pbr/images/FloorEbony_metal.png";
invertSmoothness[0] = "1";
useAnisotropic[0] = "1";
translucentBlendOp = "None";
materialTag0 = "pbr";
};

View file

@ -0,0 +1,21 @@
// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
// First, a client will always create a server in the event that they want to host a single player
// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
// in the networking short-circuited to sidestep around lag and packet transmission times.
// initServer() is called, loading the default server scripts.
// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
// to prep a playable client session.
// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
// connected to it via createAndConnectToLocalServer().
function pbr::create( %this )
{
}
function pbr::destroy( %this )
{
}

View file

@ -0,0 +1,14 @@
<ModuleDefinition
ModuleId="pbr"
VersionId="1"
Description="Module with some demonstration PBR objects/materials."
ScriptFile="pbr.cs"
CreateFunction="create"
DestroyFunction="destroy"
Group="Game">
<DeclaredAssets
canSave="true"
canSaveDynamicFields="true"
Extension="asset.taml"
Recurse="true" />
</ModuleDefinition>

View file

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asset>
<contributor>
<author>rexti</author>
<authoring_tool>OpenCOLLADA for 3ds Max; Version: 1.6; Revision: 65</authoring_tool>
<source_data>file:///C:/Users/rexti/Desktop/mesh/floor/floor.max</source_data>
</contributor>
<created>2018-10-30T22:45:39</created>
<modified>2018-10-30T22:45:39</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_effects>
<effect id="floor_mat">
<profile_COMMON>
<technique sid="common">
<phong>
<emission>
<color>0 0 0 1</color>
</emission>
<ambient>
<color>0.933 0.774 0.374 1</color>
</ambient>
<diffuse>
<color>0.933 0.774 0.374 1</color>
</diffuse>
<specular>
<color>0.933 0.774 0.374 1</color>
</specular>
<shininess>
<float>92</float>
</shininess>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_materials>
<material id="floor_mat-material" name="floor_mat">
<instance_effect url="#floor_mat"/>
</material>
</library_materials>
<library_geometries>
<geometry id="geom-floor_geom" name="floor_geom">
<mesh>
<source id="geom-floor_geom-positions">
<float_array id="geom-floor_geom-positions-array" count="243">-0.762 -0.762 0 -0.5715 -0.762 0 -0.381 -0.762 0 -0.1905 -0.762 0 0 -0.762 0 0.1905 -0.762 0 0.381 -0.762 0 0.5715 -0.762 0 0.762 -0.762 0 -0.762 -0.5715 0 -0.5715 -0.5715 0 -0.381 -0.5715 0 -0.1905 -0.5715 0 0 -0.5715 0 0.1905 -0.5715 0 0.381 -0.5715 0 0.5715 -0.5715 0 0.762 -0.5715 0 -0.762 -0.381 0 -0.5715 -0.381 0 -0.381 -0.381 0 -0.1905 -0.381 0 0 -0.381 0 0.1905 -0.381 0 0.381 -0.381 0 0.5715 -0.381 0 0.762 -0.381 0 -0.762 -0.1905 0 -0.5715 -0.1905 0 -0.381 -0.1905 0 -0.1905 -0.1905 0 0 -0.1905 0 0.1905 -0.1905 0 0.381 -0.1905 0 0.5715 -0.1905 0 0.762 -0.1905 0 -0.762 0 0 -0.5715 0 0 -0.381 0 0 -0.1905 0 0 0 0 0 0.1905 0 0 0.381 0 0 0.5715 0 0 0.762 0 0 -0.762 0.1905 0 -0.5715 0.1905 0 -0.381 0.1905 0 -0.1905 0.1905 0 0 0.1905 0 0.1905 0.1905 0 0.381 0.1905 0 0.5715 0.1905 0 0.762 0.1905 0 -0.762 0.381 0 -0.5715 0.381 0 -0.381 0.381 0 -0.1905 0.381 0 0 0.381 0 0.1905 0.381 0 0.381 0.381 0 0.5715 0.381 0 0.762 0.381 0 -0.762 0.5715 0 -0.5715 0.5715 0 -0.381 0.5715 0 -0.1905 0.5715 0 0 0.5715 0 0.1905 0.5715 0 0.381 0.5715 0 0.5715 0.5715 0 0.762 0.5715 0 -0.762 0.762 0 -0.5715 0.762 0 -0.381 0.762 0 -0.1905 0.762 0 0 0.762 0 0.1905 0.762 0 0.381 0.762 0 0.5715 0.762 0 0.762 0.762 0</float_array>
<technique_common>
<accessor source="#geom-floor_geom-positions-array" count="81" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="geom-floor_geom-normals">
<float_array id="geom-floor_geom-normals-array" count="243">0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 0.9999999 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 0.9999999 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9999999 0 0 0.9999999 0 0 0.9999999 0 0 0.9999999 0 0 1 0 0 1</float_array>
<technique_common>
<accessor source="#geom-floor_geom-normals-array" count="81" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="geom-floor_geom-map1">
<float_array id="geom-floor_geom-map1-array" count="243">0 0 0 0.625 0 0 1.25 0 0 1.875 0 0 2.5 0 0 3.125 0 0 3.75 0 0 4.375 0 0 5 0 0 0 0.625 0 0.625 0.625 0 1.25 0.625 0 1.875 0.625 0 2.5 0.625 0 3.125 0.625 0 3.75 0.625 0 4.375 0.625 0 5 0.625 0 0 1.25 0 0.625 1.25 0 1.25 1.25 0 1.875 1.25 0 2.5 1.25 0 3.125 1.25 0 3.75 1.25 0 4.375 1.25 0 5 1.25 0 0 1.875 0 0.625 1.875 0 1.25 1.875 0 1.875 1.875 0 2.5 1.875 0 3.125 1.875 0 3.75 1.875 0 4.375 1.875 0 5 1.875 0 0 2.5 0 0.625 2.5 0 1.25 2.5 0 1.875 2.5 0 2.5 2.5 0 3.125 2.5 0 3.75 2.5 0 4.375 2.5 0 5 2.5 0 0 3.125 0 0.625 3.125 0 1.25 3.125 0 1.875 3.125 0 2.5 3.125 0 3.125 3.125 0 3.75 3.125 0 4.375 3.125 0 5 3.125 0 0 3.75 0 0.625 3.75 0 1.25 3.75 0 1.875 3.75 0 2.5 3.75 0 3.125 3.75 0 3.75 3.75 0 4.375 3.75 0 5 3.75 0 0 4.375 0 0.625 4.375 0 1.25 4.375 0 1.875 4.375 0 2.5 4.375 0 3.125 4.375 0 3.75 4.375 0 4.375 4.375 0 5 4.375 0 0 5 0 0.625 5 0 1.25 5 0 1.875 5 0 2.5 5 0 3.125 5 0 3.75 5 0 4.375 5 0 5 5 0</float_array>
<technique_common>
<accessor source="#geom-floor_geom-map1-array" count="81" stride="3">
<param name="S" type="float"/>
<param name="T" type="float"/>
<param name="P" type="float"/>
</accessor>
</technique_common>
</source>
<source id="geom-floor_geom-map1-textangents">
<float_array id="geom-floor_geom-map1-textangents-array" count="243">1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0</float_array>
<technique_common>
<accessor source="#geom-floor_geom-map1-textangents-array" count="81" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="geom-floor_geom-map1-texbinormals">
<float_array id="geom-floor_geom-map1-texbinormals-array" count="243">0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0</float_array>
<technique_common>
<accessor source="#geom-floor_geom-map1-texbinormals-array" count="81" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="geom-floor_geom-vertices">
<input semantic="POSITION" source="#geom-floor_geom-positions"/>
</vertices>
<triangles material="floor_mat" count="128">
<input semantic="VERTEX" source="#geom-floor_geom-vertices" offset="0"/>
<input semantic="NORMAL" source="#geom-floor_geom-normals" offset="1"/>
<input semantic="TEXCOORD" source="#geom-floor_geom-map1" offset="2" set="0"/>
<input semantic="TEXTANGENT" source="#geom-floor_geom-map1-textangents" offset="3" set="1"/>
<input semantic="TEXBINORMAL" source="#geom-floor_geom-map1-texbinormals" offset="3" set="1"/>
<p>0 0 0 0 1 1 1 1 10 2 10 2 10 2 10 2 9 3 9 3 0 0 0 0 1 1 1 1 2 4 2 4 11 5 11 5 11 5 11 5 10 2 10 2 1 1 1 1 2 4 2 4 3 6 3 6 12 7 12 7 12 7 12 7 11 5 11 5 2 4 2 4 3 6 3 6 4 8 4 8 13 9 13 9 13 9 13 9 12 7 12 7 3 6 3 6 4 8 4 8 5 10 5 10 14 11 14 11 14 11 14 11 13 9 13 9 4 8 4 8 5 10 5 10 6 12 6 12 15 13 15 13 15 13 15 13 14 11 14 11 5 10 5 10 6 12 6 12 7 14 7 14 16 15 16 15 16 15 16 15 15 13 15 13 6 12 6 12 7 14 7 14 8 16 8 16 17 17 17 17 17 17 17 17 16 15 16 15 7 14 7 14 9 3 9 3 10 2 10 2 19 18 19 18 19 18 19 18 18 19 18 19 9 3 9 3 10 2 10 2 11 5 11 5 20 20 20 20 20 20 20 20 19 18 19 18 10 2 10 2 11 5 11 5 12 7 12 7 21 21 21 21 21 21 21 21 20 20 20 20 11 5 11 5 12 7 12 7 13 9 13 9 22 22 22 22 22 22 22 22 21 21 21 21 12 7 12 7 13 9 13 9 14 11 14 11 23 23 23 23 23 23 23 23 22 22 22 22 13 9 13 9 14 11 14 11 15 13 15 13 24 24 24 24 24 24 24 24 23 23 23 23 14 11 14 11 15 13 15 13 16 15 16 15 25 25 25 25 25 25 25 25 24 24 24 24 15 13 15 13 16 15 16 15 17 17 17 17 26 26 26 26 26 26 26 26 25 25 25 25 16 15 16 15 18 19 18 19 19 18 19 18 28 27 28 27 28 27 28 27 27 28 27 28 18 19 18 19 19 18 19 18 20 20 20 20 29 29 29 29 29 29 29 29 28 27 28 27 19 18 19 18 20 20 20 20 21 21 21 21 30 30 30 30 30 30 30 30 29 29 29 29 20 20 20 20 21 21 21 21 22 22 22 22 31 31 31 31 31 31 31 31 30 30 30 30 21 21 21 21 22 22 22 22 23 23 23 23 32 32 32 32 32 32 32 32 31 31 31 31 22 22 22 22 23 23 23 23 24 24 24 24 33 33 33 33 33 33 33 33 32 32 32 32 23 23 23 23 24 24 24 24 25 25 25 25 34 34 34 34 34 34 34 34 33 33 33 33 24 24 24 24 25 25 25 25 26 26 26 26 35 35 35 35 35 35 35 35 34 34 34 34 25 25 25 25 27 28 27 28 28 27 28 27 37 36 37 36 37 36 37 36 36 37 36 37 27 28 27 28 28 27 28 27 29 29 29 29 38 38 38 38 38 38 38 38 37 36 37 36 28 27 28 27 29 29 29 29 30 30 30 30 39 39 39 39 39 39 39 39 38 38 38 38 29 29 29 29 30 30 30 30 31 31 31 31 40 40 40 40 40 40 40 40 39 39 39 39 30 30 30 30 31 31 31 31 32 32 32 32 41 41 41 41 41 41 41 41 40 40 40 40 31 31 31 31 32 32 32 32 33 33 33 33 42 42 42 42 42 42 42 42 41 41 41 41 32 32 32 32 33 33 33 33 34 34 34 34 43 43 43 43 43 43 43 43 42 42 42 42 33 33 33 33 34 34 34 34 35 35 35 35 44 44 44 44 44 44 44 44 43 43 43 43 34 34 34 34 36 37 36 37 37 36 37 36 46 45 46 45 46 45 46 45 45 46 45 46 36 37 36 37 37 36 37 36 38 38 38 38 47 47 47 47 47 47 47 47 46 45 46 45 37 36 37 36 38 38 38 38 39 39 39 39 48 48 48 48 48 48 48 48 47 47 47 47 38 38 38 38 39 39 39 39 40 40 40 40 49 49 49 49 49 49 49 49 48 48 48 48 39 39 39 39 40 40 40 40 41 41 41 41 50 50 50 50 50 50 50 50 49 49 49 49 40 40 40 40 41 41 41 41 42 42 42 42 51 51 51 51 51 51 51 51 50 50 50 50 41 41 41 41 42 42 42 42 43 43 43 43 52 52 52 52 52 52 52 52 51 51 51 51 42 42 42 42 43 43 43 43 44 44 44 44 53 53 53 53 53 53 53 53 52 52 52 52 43 43 43 43 45 46 45 46 46 45 46 45 55 54 55 54 55 54 55 54 54 55 54 55 45 46 45 46 46 45 46 45 47 47 47 47 56 56 56 56 56 56 56 56 55 54 55 54 46 45 46 45 47 47 47 47 48 48 48 48 57 57 57 57 57 57 57 57 56 56 56 56 47 47 47 47 48 48 48 48 49 49 49 49 58 58 58 58 58 58 58 58 57 57 57 57 48 48 48 48 49 49 49 49 50 50 50 50 59 59 59 59 59 59 59 59 58 58 58 58 49 49 49 49 50 50 50 50 51 51 51 51 60 60 60 60 60 60 60 60 59 59 59 59 50 50 50 50 51 51 51 51 52 52 52 52 61 61 61 61 61 61 61 61 60 60 60 60 51 51 51 51 52 52 52 52 53 53 53 53 62 62 62 62 62 62 62 62 61 61 61 61 52 52 52 52 54 55 54 55 55 54 55 54 64 63 64 63 64 63 64 63 63 64 63 64 54 55 54 55 55 54 55 54 56 56 56 56 65 65 65 65 65 65 65 65 64 63 64 63 55 54 55 54 56 56 56 56 57 57 57 57 66 66 66 66 66 66 66 66 65 65 65 65 56 56 56 56 57 57 57 57 58 58 58 58 67 67 67 67 67 67 67 67 66 66 66 66 57 57 57 57 58 58 58 58 59 59 59 59 68 68 68 68 68 68 68 68 67 67 67 67 58 58 58 58 59 59 59 59 60 60 60 60 69 69 69 69 69 69 69 69 68 68 68 68 59 59 59 59 60 60 60 60 61 61 61 61 70 70 70 70 70 70 70 70 69 69 69 69 60 60 60 60 61 61 61 61 62 62 62 62 71 71 71 71 71 71 71 71 70 70 70 70 61 61 61 61 63 64 63 64 64 63 64 63 73 72 73 72 73 72 73 72 72 73 72 73 63 64 63 64 64 63 64 63 65 65 65 65 74 74 74 74 74 74 74 74 73 72 73 72 64 63 64 63 65 65 65 65 66 66 66 66 75 75 75 75 75 75 75 75 74 74 74 74 65 65 65 65 66 66 66 66 67 67 67 67 76 76 76 76 76 76 76 76 75 75 75 75 66 66 66 66 67 67 67 67 68 68 68 68 77 77 77 77 77 77 77 77 76 76 76 76 67 67 67 67 68 68 68 68 69 69 69 69 78 78 78 78 78 78 78 78 77 77 77 77 68 68 68 68 69 69 69 69 70 70 70 70 79 79 79 79 79 79 79 79 78 78 78 78 69 69 69 69 70 70 70 70 71 71 71 71 80 80 80 80 80 80 80 80 79 79 79 79 70 70 70 70</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_lights>
<light id="EnvironmentAmbientLight" name="EnvironmentAmbientLight">
<technique_common>
<ambient>
<color>0 0 0</color>
</ambient>
</technique_common>
</light>
</library_lights>
<library_visual_scenes>
<visual_scene id="MaxScene">
<node name="EnvironmentAmbientLight">
<instance_light url="#EnvironmentAmbientLight"/>
</node>
<node id="node-floor_geom" name="floor_geom">
<translate>0.003635618 0.049337 0</translate>
<scale>10 10 10</scale>
<instance_geometry url="#geom-floor_geom">
<bind_material>
<technique_common>
<instance_material symbol="floor_mat" target="#floor_mat-material"/>
</technique_common>
</bind_material>
</instance_geometry>
<extra>
<technique profile="OpenCOLLADA">
<cast_shadows sid="cast_shadows" type="bool">1</cast_shadows>
<receive_shadows sid="receive_shadows" type="bool">1</receive_shadows>
<primary_visibility sid="primary_visibility" type="bool">1</primary_visibility>
<secondary_visibility sid="secondary_visibility" type="bool">1</secondary_visibility>
</technique>
</extra>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#MaxScene"/>
</scene>
</COLLADA>

File diff suppressed because one or more lines are too long

View file

@ -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 );

View file

@ -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

View file

@ -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
//------------------------------------------------------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB