init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
44
gamedata/shaders/d3d11/fluid_jacobi.ps.hlsl
Normal file
44
gamedata/shaders/d3d11/fluid_jacobi.ps.hlsl
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#include "fluid_common.hlsli"
|
||||
|
||||
// Pixel
|
||||
float4 main(p_fluidsim input) : SV_Target
|
||||
{
|
||||
float pCenter = Texture_pressure.SampleLevel(samPointClamp, input.texcoords, 0).x;
|
||||
// Texture_tempvector contains the "divergence" computed by PS_DIVERGENCE
|
||||
float bC = Texture_tempvector.SampleLevel(samPointClamp, input.texcoords, 0).x;
|
||||
|
||||
float pL = Texture_pressure.SampleLevel(samPointClamp, LEFTCELL, 0).x;
|
||||
float pR = Texture_pressure.SampleLevel(samPointClamp, RIGHTCELL, 0).x;
|
||||
float pB = Texture_pressure.SampleLevel(samPointClamp, BOTTOMCELL, 0).x;
|
||||
float pT = Texture_pressure.SampleLevel(samPointClamp, TOPCELL, 0).x;
|
||||
float pD = Texture_pressure.SampleLevel(samPointClamp, DOWNCELL, 0).x;
|
||||
float pU = Texture_pressure.SampleLevel(samPointClamp, UPCELL, 0).x;
|
||||
|
||||
if (IsBoundaryCell(LEFTCELL))
|
||||
{
|
||||
pL = pCenter;
|
||||
}
|
||||
if (IsBoundaryCell(RIGHTCELL))
|
||||
{
|
||||
pR = pCenter;
|
||||
}
|
||||
if (IsBoundaryCell(BOTTOMCELL))
|
||||
{
|
||||
pB = pCenter;
|
||||
}
|
||||
if (IsBoundaryCell(TOPCELL))
|
||||
{
|
||||
pT = pCenter;
|
||||
}
|
||||
if (IsBoundaryCell(DOWNCELL))
|
||||
{
|
||||
pD = pCenter;
|
||||
}
|
||||
if (IsBoundaryCell(UPCELL))
|
||||
{
|
||||
pU = pCenter;
|
||||
}
|
||||
|
||||
return (pL + pR + pB + pT + pU + pD - bC) / 6.0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue