init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
29
gamedata/shaders/d3d11/fluid_obst_dynamic_oobb.ps.hlsl
Normal file
29
gamedata/shaders/d3d11/fluid_obst_dynamic_oobb.ps.hlsl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "fluid_common.hlsli"
|
||||
|
||||
struct PSDrawBoxOut
|
||||
{
|
||||
float4 obstacle : SV_TARGET0;
|
||||
float4 velocity : SV_TARGET1;
|
||||
};
|
||||
|
||||
// Pixel
|
||||
PSDrawBoxOut main(p_fluidsim_dyn_aabb input)
|
||||
{
|
||||
PSDrawBoxOut voxel;
|
||||
|
||||
// cells completely inside box = 0.5
|
||||
if ((input.clip0.x > BOX_EXPANSION) && (input.clip1.x > BOX_EXPANSION) &&
|
||||
(input.clip0.y > BOX_EXPANSION) && (input.clip1.y > BOX_EXPANSION) &&
|
||||
(input.clip0.z > BOX_EXPANSION) && (input.clip1.z > BOX_EXPANSION))
|
||||
{
|
||||
voxel.obstacle = 0.5;
|
||||
voxel.velocity = 0;
|
||||
return voxel;
|
||||
}
|
||||
else // cells in box boundary = 1.0
|
||||
{
|
||||
voxel.obstacle = 1.0;
|
||||
voxel.velocity = float4(input.velocity, 1);
|
||||
return voxel;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue