Some adjustments

This commit is contained in:
Maximilian Giller 2023-01-29 22:07:21 +01:00
parent 159e9ca843
commit 4994a23a8a

View file

@ -74,17 +74,15 @@ int main()
// initialize renderer: aperture = lens thickness, secondaryRayCount = how many rays per pixel are created // initialize renderer: aperture = lens thickness, secondaryRayCount = how many rays per pixel are created
float focalLength = length(camera.getPosition() - planePosition + Vector3d(0, 0, 2.6f)); float focalLength = length(camera.getPosition() - planePosition + Vector3d(0, 0, 2.6f));
DOFRenderer renderer(0.02, 100, focalLength); DOFRenderer renderer(0.02, 100, focalLength);
float imageScalar = 2; float imageScalar = 1;
Texture image = renderer.renderImage(scene, camera, 1920 * imageScalar, 1080 * imageScalar); Texture image = renderer.renderImage(scene, camera, 1920 * imageScalar, 1080 * imageScalar);
// Use post-processing Bloom effect
Bloom bloomEffect = Bloom(image.getImage());
Texture imageWithBloom = image;
imageWithBloom.setTexture(bloomEffect.bloom(0.55f, 5, 10.0f, 0.06f));
// save images
image.save("result.png"); image.save("result.png");
imageWithBloom.save("resultWithBloom.png");
// Use post-processing Bloom effect
Bloom bloomEffect = Bloom(image.getImage(), 0.88f, image);
image.setTexture(bloomEffect.bloom(50, 20.0f, 0.5f));
image.save("resultWithBloom.png");
return 0; return 0;
} }