mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 00:44:43 -05:00
Super-fast volume (aka Downscaled Volume Rendering).
This commit is contained in:
@@ -224,6 +224,18 @@ namespace openspace {
|
||||
LERROR("No volume dimensions specified.");
|
||||
}
|
||||
|
||||
if (volumeDictionary.hasKey("Steps")) {
|
||||
_rayCastSteps = static_cast<int>(volumeDictionary.value<float>("Steps"));
|
||||
}
|
||||
else {
|
||||
LINFO("Number of raycasting steps not specified for Milkway Galaxy."
|
||||
" Using default value.");
|
||||
}
|
||||
|
||||
if (volumeDictionary.hasKey("Downscale")) {
|
||||
_downScaleVolumeRendering = volumeDictionary.value<float>("Downscale");
|
||||
}
|
||||
|
||||
if (!dictionary.hasKeyAndValue<ghoul::Dictionary>("Points")) {
|
||||
LERROR("No points dictionary specified.");
|
||||
}
|
||||
@@ -470,6 +482,8 @@ void RenderableGalaxy::update(const UpdateData& data) {
|
||||
volumeTransform[3] += translation;
|
||||
_pointTransform[3] += translation;
|
||||
|
||||
_raycaster->setDownscaleRender(_downScaleVolumeRendering);
|
||||
_raycaster->setMaxSteps(_rayCastSteps);
|
||||
_raycaster->setStepSize(_stepSize);
|
||||
_raycaster->setAspect(_aspect);
|
||||
_raycaster->setModelTransform(volumeTransform);
|
||||
|
||||
@@ -79,6 +79,8 @@ private:
|
||||
glm::ivec3 _volumeDimensions;
|
||||
std::string _pointsFilename;
|
||||
std::string _pointSpreadFunctionTexturePath;
|
||||
int _rayCastSteps = 1000;
|
||||
float _downScaleVolumeRendering = 1.f;
|
||||
|
||||
std::unique_ptr<GalaxyRaycaster> _raycaster;
|
||||
std::unique_ptr<volume::RawVolume<glm::tvec4<GLubyte>>> _volume;
|
||||
|
||||
Reference in New Issue
Block a user