/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/ThirdParty/Jolt/Shaders/HairGridNormalize.hlsl
26 строк
705 B
Jan Krassnigg
Updated Jolt to version 5.5.0 (#1778)
20 янв 2026, 10:54
Не верифицирован
20 янв 2026, 10:54
c41ee15
Код
Авторство
О чём код?
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics) // SPDX-FileCopyrightText: 2026 Jorrit Rouwe // SPDX-License-Identifier: MIT #include "HairGridNormalizeBindings.h" #include "HairCommon.h" JPH_SHADER_FUNCTION_BEGIN(void, main, cHairPerGridCellBatch, 1, 1) JPH_SHADER_PARAM_THREAD_ID(tid) JPH_SHADER_FUNCTION_END { uint index = tid.x; if (index >= cNumGridPoints) return; // Convert from fixed point back to float and divide velocity by density to get average velocity float4 v = (float4)gVelocityAndDensity[index] * cFixedToFloat; float density = v.w; if (density > 1.0e-12f) { v.x /= density; v.y /= density; v.z /= density; } gVelocityAndDensity[index] = asint(v); }