/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Data/Base/Shaders/RenderGraph/RenderGraphReadTexel.h
30 строк
741 B
Sanakan8472
Render Graph Inspector (#1968)
24 июн 2026, 10:00
Не верифицирован
24 июн 2026, 10:00
e9cca37
Код
Авторство
О чём код?
#if MSAA Texture2DMS<float4> SourceTexture BIND_GROUP(BG_DRAW_CALL); #else Texture2D SourceTexture BIND_GROUP(BG_DRAW_CALL); #endif float4 ReadTexel(int2 pixelPosition, int sampleIndex, uint sampleCount) { #if MSAA if (sampleIndex >= 0) { return SourceTexture.Load(pixelPosition, sampleIndex); } float4 result = 0.0f; for (uint sample = 0; sample < sampleCount; ++sample) { result += SourceTexture.Load(pixelPosition, int(sample)); } return result / float(sampleCount); #else return SourceTexture.Load(int3(pixelPosition, 0)); #endif } float4 ApplyValueRange(float4 value, float rangeMin, float rangeMax) { float invRange = 1.0f / max(rangeMax - rangeMin, 0.0000001f); return (value - rangeMin) * invRange; }