diff --git a/data/assets/customization/volumes.asset b/data/assets/customization/volumes.asset index c83a5ea4af..5b9e5b711f 100644 --- a/data/assets/customization/volumes.asset +++ b/data/assets/customization/volumes.asset @@ -8,9 +8,9 @@ local MilkyWayVolumeGalaxy = { Parent = transforms.SolarSystemBarycenter.Identifier, Renderable = { Type = "RenderableGalaxy", - StepSize = 0.015, - AbsorptionMultiply = 100, - EmissionMultiply = 500, + StepSize = 0.01, + AbsorptionMultiply = 10, + EmissionMultiply = 100, Translation = {0.17, 0, 0}, Volume = { Type = "Volume", diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index c78074ea61..40b2d19c26 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -104,8 +104,8 @@ namespace openspace { RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _stepSize(StepSizeInfo, 0.01f, 0.0005f, 0.05f, 0.001f) - , _absorptionMultiply(AbsorptionMultiplyInfo, 50.f, 0.0f, 500.0f) - , _emissionMultiply(EmissionMultiplyInfo, 1500.f, 0.0f, 3000.0f) + , _absorptionMultiply(AbsorptionMultiplyInfo, 40.f, 0.0f, 100.0f) + , _emissionMultiply(EmissionMultiplyInfo, 400.f, 0.0f, 1000.0f) //, _pointStepSize(PointStepSizeInfo, 0.01f, 0.01f, 0.1f) //, _enabledPointsRatio(EnabledPointsRatioInfo, 0.2f, 0.f, 1.f) , _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f)) diff --git a/modules/galaxy/shaders/galaxyraycast.glsl b/modules/galaxy/shaders/galaxyraycast.glsl index 1a4d41aa64..453ef60ae0 100644 --- a/modules/galaxy/shaders/galaxyraycast.glsl +++ b/modules/galaxy/shaders/galaxyraycast.glsl @@ -41,7 +41,8 @@ void sample#{id}(vec3 samplePos, vec4 sampledColor = texture(galaxyTexture#{id}, samplePos.xyz); - float STEP_SIZE = maxStepSize#{id}; + //float STEP_SIZE = maxStepSize#{id}*0.5; + float STEP_SIZE = 1 / 256.0; vec3 alphaTint = vec3(0.3, 0.54, 0.85); @@ -50,28 +51,23 @@ void sample#{id}(vec3 samplePos, sampledColor = sampledColor*sampledColor; // fudge for the dust "spreading" + sampledColor.a = clamp(sampledColor.a, 0.0, 1.0) * opacityCoefficient#{id}; sampledColor.a = pow(sampledColor.a, 0.7); // absorption probability - float scaled_density = sampledColor.a * STEP_SIZE * absorptionMultiply#{id} * 10; + float scaled_density = sampledColor.a * STEP_SIZE * absorptionMultiply#{id}; vec3 absorption = alphaTint * scaled_density; // extinction vec3 extinction = exp(-absorption); - sampledColor.rgb = sampledColor.rgb * extinction; + accumulatedColor.rgb *= extinction; // emission - sampledColor.rgb += sampledColor.rgb * STEP_SIZE * emissionMultiply#{id}; - - //sampledColor.a = sampledColor.a * 50; //1.0; - - vec3 backAlpha = sampledColor.aaa * 10.0; - sampledColor.rgb = sampledColor.rgb * backAlpha; + accumulatedColor.rgb += sampledColor.rgb * STEP_SIZE * emissionMultiply#{id}; - sampledColor.a = clamp(sampledColor.a, 0.0, 1.0) * opacityCoefficient#{id}; vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha; - accumulatedColor += oneMinusFrontAlpha * sampledColor.rgb; - accumulatedAlpha += oneMinusFrontAlpha * sampledColor.a; + //accumulatedColor += oneMinusFrontAlpha * sampledColor.rgb; + accumulatedAlpha += oneMinusFrontAlpha * sampledColor.rgb; } float stepSize#{id}(vec3 samplePos, vec3 dir) {