lots of updates
This commit is contained in:
33
funnyassets/shaders/brdf.hlsl
Normal file
33
funnyassets/shaders/brdf.hlsl
Normal 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;
|
||||
}
|
||||
}
|
||||
12
funnyassets/shaders/fgui/text.shader
Normal file
12
funnyassets/shaders/fgui/text.shader
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "../macros.hlsl"
|
||||
COMMON
|
||||
{
|
||||
|
||||
}
|
||||
VS
|
||||
{
|
||||
|
||||
}
|
||||
PS
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[Inputs]
|
||||
|
||||
@@ -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
|
||||
54
funnyassets/shaders/mesh_raster.shader
Normal file
54
funnyassets/shaders/mesh_raster.shader
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user