lots of updates

This commit is contained in:
2026-02-19 00:39:20 +02:00
parent 898bf90504
commit 4dd2e13c48
53 changed files with 1495 additions and 250 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +0,0 @@
parent rtt_simple_pbr
albedo textures/bricks.png

View File

@@ -0,0 +1,4 @@
{
"shader": "mesh_raster.shader",
"albedo": "bricks.png"
}

Binary file not shown.

View File

@@ -0,0 +1,7 @@
[
{
"model": "cube.fmesh",
"material": "cube.fmat",
"physics": "cube.fmesh"
}
]

View File

@@ -0,0 +1,33 @@
float GetSpecularThreshold( float m_fMetalness )
{
return 0;
}
struct BRDF_Data
{
float3 m_vRayIn;
float3 m_vRayOut;
float3 m_vNormal;
float3 m_vAlbedo;
float m_fRoughness;
float m_fMetalness;
float FresnelDiffuseTerm( float fSine )
{
return (fSine * (1 - 0.5 * m_fRoughness) + 0.5 * m_fRoughness);
}
float3 BurleyDiffuse( )
{
float fSineNormalLight = saturate(dot(m_vNormal, m_vRayOut));
float fSineNormalView = saturate(dot(m_vNormal, m_vRayIn));
float fFresnelLight = FresnelDiffuseTerm(fSineNormalLight);
float fFresnelView = FresnelDiffuseTerm(fSineNormalView);
return fFresnelView * fFresnelLight;
}
float3 GetOutGoingDirection()
{
return 0;
}
}

View File

@@ -0,0 +1,12 @@
#include "../macros.hlsl"
COMMON
{
}
VS
{
}
PS
{
}

View File

@@ -1,17 +1,4 @@
#define COMMON using namespace Common; namespace Common
#ifdef VS_SHADER
#define VS using namespace VertexShader; namespace VertexShader
#else
#define VS namespace VertexShader_DO_NOT_USE
#endif
#ifdef PS_SHADER
#define PS using namespace PixelShader; namespace PixelShader
#else
#define PS namespace PixelShader_DO_NOT_USE
#endif
#include "macros.hlsl"
COMMON
{

View File

@@ -1,2 +0,0 @@
[Inputs]

View File

@@ -1,3 +1,6 @@
#ifndef MACROS_H
#define MACROS_H
#define COMMON using namespace Common; namespace Common
#ifdef VS_SHADER
@@ -12,32 +15,4 @@
#define PS namespace PixelShader_DO_NOT_USE
#endif
COMMON
{
struct PS_INPUT
{
float4 m_vPosition : SV_Position;
}
}
VS
{
struct VS_INPUT
{
float3 m_vPosition: POSITION;
}
PS_INPUT vsMain( VS_INPUT i )
{
PS_INPUT o;
o.m_vPosition = { i.m_vPosition, 1 };
return o;
}
}
PS
{
float4 psMain( PS_INPUT i )
{
return float4(1);
}
}
#endif

View File

@@ -0,0 +1,54 @@
#include "macros.hlsl"
COMMON {
cbuffer CameraInfo
{
float4x4 g_matViewProjection;
};
struct PerModelData
{
float4x4 m_matTranslation;
}
StructuredBuffer<PerModelData> g_modelData;
struct PS_INPUT
{
float4 m_vScreenPosition: SV_POSITION;
float4 m_vWorldPosition: POSITION;
}
}
VS
{
struct VS_INPUT
{
float3 m_vPosition: POSITION;
}
PS_INPUT vsMain( VS_INPUT input )
{
PS_INPUT output = {};
output.m_vScreenPosition = float4(input.m_vPosition, 1);
output.m_vScreenPosition = mul(
output.m_vScreenPosition,
g_modelData[0].m_matTranslation
);
output.m_vScreenPosition = mul(
output.m_vScreenPosition,
g_matViewProjection
);
output.m_vWorldPosition = float4(input.m_vPosition, 1);
return output;
}
}
PS
{
#include "brdf.hlsl"
float4 psMain( PS_INPUT input )
{
float4 vWorldSpacePosition = input.m_vWorldPosition;
return float4(vWorldSpacePosition);
}
}