mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 13:08:49 -05:00
Changed behaviou of max billboard sizes.
This commit is contained in:
@@ -877,7 +877,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
|
||||
// Almost Working
|
||||
glm::dmat4 invMVPParts = glm::inverse(modelMatrix) * glm::inverse(data.camera.combinedViewMatrix()) *
|
||||
glm::dmat4 invMVPParts = worldToModelTransform * glm::inverse(data.camera.combinedViewMatrix()) *
|
||||
glm::inverse(glm::dmat4(projectionMatrix));
|
||||
glm::dvec3 orthoRight = glm::dvec3(glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0))));
|
||||
glm::dvec3 orthoUp = glm::dvec3(glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0))));
|
||||
|
||||
@@ -159,12 +159,29 @@ void main() {
|
||||
|
||||
if ((height > maxBillboardSize) ||
|
||||
(width > maxBillboardSize)) {
|
||||
//return;
|
||||
|
||||
// Set maximum size as Carter's instructions
|
||||
float correctionScale = height > maxBillboardSize ? maxBillboardSize / (topRight.y - bottomLeft.y) :
|
||||
maxBillboardSize / (topRight.x - bottomLeft.x);
|
||||
|
||||
scaledRight = correctionScale * scaleMultiply * right/2.0f;
|
||||
scaledUp = correctionScale * scaleMultiply * up/2.0f;
|
||||
initialPosition = z_normalization(vec4(modelViewProjectionTransform *
|
||||
dvec4(dpos.xyz - scaledRight - scaledUp, dpos.w)));
|
||||
vs_screenSpaceDepth = initialPosition.w;
|
||||
secondPosition = z_normalization(vec4(modelViewProjectionTransform *
|
||||
dvec4(dpos.xyz + scaledRight - scaledUp, dpos.w)));
|
||||
crossCorner = z_normalization(vec4(modelViewProjectionTransform *
|
||||
dvec4(dpos.xyz + scaledUp + scaledRight, dpos.w)));
|
||||
thirdPosition = z_normalization(vec4(modelViewProjectionTransform *
|
||||
dvec4(dpos.xyz + scaledUp - scaledRight, dpos.w)));
|
||||
|
||||
// Fade-out
|
||||
float maxVar = 3.0f * maxBillboardSize;
|
||||
float minVar = maxBillboardSize;
|
||||
ta = 1.0f - ( (var - minVar)/(maxVar - minVar) );
|
||||
if (ta == 0.0f)
|
||||
return;
|
||||
return;
|
||||
}
|
||||
else if (width < 2.0f * minBillboardSize) {
|
||||
//return;
|
||||
|
||||
+3
-1
@@ -9,7 +9,9 @@ return {
|
||||
-- A regular 1280x720 window
|
||||
SGCTConfig = sgct.config.single{1280, 720},
|
||||
-- SGCTConfig = sgct.config.single{1280, 720, scene={orientation = { yaw = 120, pitch = 15, roll = 0.0 }}},
|
||||
--SGCTConfig = "${CONFIG}/single_two_win.xml",
|
||||
--SGCTConfig = "${CONFIG}/single_two_win.xml",
|
||||
|
||||
--SGCTConfig = "${CONFIG}/spout_output.xml",
|
||||
|
||||
-- A regular 1920x1080 window
|
||||
--SGCTConfig = sgct.config.single{1920, 1080},
|
||||
|
||||
Reference in New Issue
Block a user