/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Data/Base/Shaders/Debug/DebugGeometry.ezShader
75 строк
1 KB
C-Core
Render instance data refactor (#1713)
19 ноя 2025, 20:31
Не верифицирован
19 ноя 2025, 20:31
b8e6103
Код
Авторство
О чём код?
[PLATFORMS] ALL [PERMUTATIONS] CAMERA_MODE TOPOLOGY [RENDERSTATE] BlendingEnabled0 = true DestBlend0 = Blend_InvSrcAlpha SourceBlend0 = Blend_SrcAlpha DestBlendAlpha0 = Blend_InvSrcAlpha DepthTest = true DepthWrite = true [VERTEXSHADER] #define USE_COLOR0 #include <Shaders/Common/GlobalConstants.h> #include <Shaders/Materials/MaterialInterpolator.h> struct BoxData { Transform transform; float4 color; }; StructuredBuffer<BoxData> boxData BIND_GROUP(BG_RENDER_PASS); struct VS_IN_POS_ONLY { float3 Position : POSITION; uint InstanceID : SV_InstanceID; }; VS_OUT main(VS_IN_POS_ONLY Input) { #if CAMERA_MODE == CAMERA_MODE_STEREO s_ActiveCameraEyeIndex = Input.InstanceID % 2; #endif #if defined(CAMERA_MODE) && CAMERA_MODE == CAMERA_MODE_STEREO float4x4 worldMatrix = TransformToMatrix(boxData[Input.InstanceID / 2].transform); #else float4x4 worldMatrix = TransformToMatrix(boxData[Input.InstanceID].transform); #endif float4 worldPos = mul(worldMatrix, float4(Input.Position, 1.0f)); VS_OUT RetVal; RetVal.Position = mul(GetWorldToScreenMatrix(), worldPos); #if defined(CAMERA_MODE) && CAMERA_MODE == CAMERA_MODE_STEREO RetVal.Color0 = boxData[Input.InstanceID / 2].color; RetVal.RenderTargetArrayIndex = Input.InstanceID % 2; #else RetVal.Color0 = boxData[Input.InstanceID].color; #endif return RetVal; } [PIXELSHADER] #define USE_COLOR0 #include <Shaders/Materials/MaterialInterpolator.h> float4 main(PS_IN Input) : SV_Target { return Input.Color0; }