Skip to content

Commit

Permalink
Merge branch 'main' of github.com:simul/Platform
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRichards-Code committed Aug 6, 2024
2 parents 8477327 + b91b9c6 commit 6545898
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CrossPlatform/RenderPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,7 @@ SamplerState *RenderPlatform::GetOrCreateSamplerStateByName (const char *name_ut
}
else
{
ss=CreateSamplerState(desc);
ss=desc?CreateSamplerState(desc):nullptr;
sharedSamplerStates[str]=ss;
}
return ss;
Expand Down
16 changes: 16 additions & 0 deletions CrossPlatform/Shaders/random.sl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ vec3 PcgRand3(uint seed)
return r;
}


vec3 PcgSphericalRandom(uint seed)
{
vec3 pcgrand=PcgRand3(seed);
float r =1.f-pow(pcgrand.x,4.0);
float az =pcgrand.y*2*3.1415926536;
float sine_el =pcgrand.z*2.0-1.0;
float el =asin(sine_el);
float cos_el =cos(el);
vec3 v;
v.x =r*sin(az)*cos_el;
v.y =r*cos(az)*cos_el;
v.z =r*sine_el;
return v;
}

vec4 PcgRand4(uint seed)
{
uint4 hash;
Expand Down
6 changes: 3 additions & 3 deletions CrossPlatform/Shaders/sampler_states.sl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ SamplerState clampSamplerState : register(s9), resource_group(g0)
AddressW = Clamp;
};

SamplerState wrapClampSamplerState : register(s10), resource_group(g0)
SamplerState samplerStateDummy : register(s10), resource_group(g0)
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = Wrap;
Filter = MIN_MAG_MIP_POINT;
AddressU = Clamp;
AddressV = Clamp;
AddressW = Clamp;
};
Expand Down

0 comments on commit 6545898

Please sign in to comment.