disable cloud ring
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-08-19 09:20:07 -04:00
parent af4d1317fc
commit c34e448036
3 changed files with 45 additions and 12 deletions

View File

@ -62,8 +62,10 @@ uniform sampler2D shadowMap;
//function prototypes
float calcLightIntensityTotal(vec3 normal);
float ShadowCalculation(vec4 fragPosLightSpace, vec3 lightDir, vec3 normal);
float linearizeDepth(float d,float zNear,float zFar);
float weightCalcOrigin(float finalAlpha, float zLoc, float linearizedLoc);
float weightCalcFlat(float finalAlpha, float zLoc, float linearizedLoc);
float weightCalcNew(float finalAlpha, float zLoc, float linearizedLoc);
void main(){
@ -86,14 +88,41 @@ void main(){
vec4 finalColor = vec4(shadowModifiedColor,textureColor.a);
//calculate weight function
float weight = clamp(pow(min(1.0, finalColor.a * 10.0) + 0.01, 3.0) * 1e8 *
pow(1.0 - gl_FragCoord.z * 0.9, 3.0), 1e-2, 3e3);
float linearizedDepth = linearizeDepth(gl_FragCoord.z,0.001f,20000f);
float weight = weightCalcNew(finalColor.a,gl_FragCoord.z,linearizedDepth);
//emit colors
accum = vec4(finalColor.rgb * finalColor.a, finalColor.a) * weight;
reveal = finalColor.a;
}
//a weight calculation
float weightCalcOrigin(float finalAlpha, float zLoc, float linearizedLoc){
float weight = clamp(pow(min(1.0, finalAlpha * 10.0) + 0.01, 3.0) * 1e8 *
pow(1.0 - zLoc * 0.9, 3.0), 1e-2, 3e3);
return weight;
}
//a weight calculation
float weightCalcFlat(float finalAlpha, float zLoc, float linearizedLoc){
return 0.1f;
}
//a weight calculation
float weightCalcNew(float finalAlpha, float zLoc, float linearizedLoc){
float alphaComponent = pow(min(1.0, finalAlpha * 10.0) + 0.01, 3.0);
float zComponent = pow(1.0 - zLoc * 0.9, 3.0);
float weightRaw = alphaComponent * 1e8 * zComponent;
float weight = clamp(weightRaw, 1e-2, 3e3);
return weight;
}
//Linearizes the depth
float linearizeDepth(float d,float zNear,float zFar){
return zNear * zFar / (zFar + d * (zNear - zFar));
}
float calcLightIntensityAmbient(){

View File

@ -608,6 +608,10 @@ Foliage serialization/deserialization
(08/18/2024)
Cursor transparency, cloud transparency
Small oit shader work
(08/19/2024)
Disable cloud ring
# TODO

View File

@ -199,14 +199,14 @@ public class ClientLoading {
Globals.assetManager.queueOverrideMeshShader("Models/environment/skyboxSphere.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
//cloud ring pseudo skybox
Entity cloudRing = EntityCreationUtils.createClientSpatialEntity();
EntityCreationUtils.makeEntityDrawable(cloudRing, "Models/environment/cloudRing.fbx");
DrawableUtils.makeEntityTransparent(cloudRing);
DrawableUtils.disableCulling(cloudRing);
EntityUtils.getRotation(cloudRing).rotateX((float)(-Math.PI/2.0f));
EntityUtils.getScale(cloudRing).mul(100000.0f);
Globals.clientScene.registerBehaviorTree(new ApplyRotationTree(cloudRing,new Quaterniond().rotationZ(0.0001)));
Globals.assetManager.queueOverrideMeshShader("Models/environment/cloudRing.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
// Entity cloudRing = EntityCreationUtils.createClientSpatialEntity();
// EntityCreationUtils.makeEntityDrawable(cloudRing, "Models/environment/cloudRing.fbx");
// DrawableUtils.makeEntityTransparent(cloudRing);
// DrawableUtils.disableCulling(cloudRing);
// EntityUtils.getRotation(cloudRing).rotateX((float)(-Math.PI/2.0f));
// EntityUtils.getScale(cloudRing).mul(100000.0f);
// Globals.clientScene.registerBehaviorTree(new ApplyRotationTree(cloudRing,new Quaterniond().rotationZ(0.0001)));
// Globals.assetManager.queueOverrideMeshShader("Models/environment/cloudRing.fbx", "Sphere", "Shaders/skysphere/skysphere.vs", "Shaders/skysphere/skysphere.fs");
//player's cursor
Globals.playerCursor = EntityCreationUtils.createClientSpatialEntity();