21 lines
447 B
HLSL
21 lines
447 B
HLSL
#include "fluid_common.hlsli"
|
|
|
|
float GravityBuoyancy;
|
|
|
|
// Pixel
|
|
float4 main(p_fluidsim input) : SV_Target
|
|
{
|
|
float3 npos = GetAdvectedPosTexCoords(input);
|
|
|
|
float4 Velocity = Texture_velocity0.SampleLevel(samLinear, npos, 0) * modulate;
|
|
|
|
#ifdef USE_GRAVITY
|
|
|
|
float Dencity = Texture_color.SampleLevel(samLinear, npos, 0).x;
|
|
Velocity.y += Dencity * GravityBuoyancy;
|
|
|
|
#endif // USE_GRAVITY
|
|
|
|
return Velocity;
|
|
}
|
|
|