/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Data/Plugins/ParticlePlugin/Shaders/Particles/Point.ezShader
66 строк
1 KB
Jan Krassnigg
ezPluginBundles can now configure their own data directories to use (#1985)
13 июл 2026, 10:40
Не верифицирован
13 июл 2026, 10:40
2fe8e9b
Код
Авторство
О чём код?
[PLATFORMS] ALL [PERMUTATIONS] CAMERA_MODE [RENDERSTATE] BlendingEnabled0 = false DepthTest = true DepthWrite = true [SHADER] #include <Shaders/Common/Common.h> #define USE_COLOR0 #if EZ_ENABLED(PLATFORM_VULKAN) #define CUSTOM_INTERPOLATOR [[vk::builtin("PointSize")]] float PointSize : PSIZE; #endif [VERTEXSHADER] #include <Shaders/Common/GlobalConstants.h> #include <Shaders/Materials/MaterialInterpolator.h> #include <Shaders/Particles/BillboardQuadParticleShaderData.h> VS_OUT main(uint VertexID : SV_VertexID, uint InstanceID : SV_InstanceID) { #if CAMERA_MODE == CAMERA_MODE_STEREO s_ActiveCameraEyeIndex = InstanceID % 2; #endif VS_OUT ret; #if CAMERA_MODE == CAMERA_MODE_STEREO ret.RenderTargetArrayIndex = InstanceID; #endif uint dataIndex = VertexID; ezBaseParticleShaderData baseParticle = particleBaseData[dataIndex]; ezBillboardQuadParticleShaderData billboardData = particleBillboardQuadData[dataIndex]; float4 position = float4(billboardData.Position, 1); float4 worldPosition = mul(ObjectToWorldMatrix, position); float4 screenPosition = mul(GetWorldToScreenMatrix(), worldPosition); ret.Position = screenPosition; ret.Color0 = UNPACKCOLOR4H(baseParticle.Color); #if EZ_ENABLED(PLATFORM_VULKAN) ret.PointSize = 1.0; #endif return ret; } [PIXELSHADER] #include <Shaders/Materials/MaterialInterpolator.h> float4 main(PS_IN Input) : SV_Target { return Input.Color0; }