mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-02 01:30:34 -06:00
Accretion disk texture
Co-Authored-By: Emil Wallberg <49481622+EmilWallberg@users.noreply.github.com>
This commit is contained in:
BIN
modules/blackhole/rendering/accretion_disk.png
Normal file
BIN
modules/blackhole/rendering/accretion_disk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 601 B |
@@ -190,6 +190,13 @@ namespace openspace {
|
||||
LWARNING("UniformCache is missing 'colorBVMap'");
|
||||
}
|
||||
|
||||
#ifdef M_Kerr
|
||||
ghoul::opengl::TextureUnit accretionDiskUnit;
|
||||
if (!bindTexture(_uniformCache.accretionDisk, accretionDiskUnit, _accretionDiskTexture)) {
|
||||
LWARNING("UniformCache is missing 'accretionDisk'");
|
||||
}
|
||||
#endif // M_Kerr
|
||||
|
||||
SendSchwarzschildTableToShader();
|
||||
SendStarKDTreeToShader();
|
||||
|
||||
@@ -343,7 +350,13 @@ namespace openspace {
|
||||
else {
|
||||
LWARNING(std::format("Failed to load environment texture from path '{}'", absPath(_colorBVMapTexturePath).string()));
|
||||
}
|
||||
|
||||
#if M_Kerr
|
||||
_accretionDiskTexture = ghoul::io::TextureReader::ref().loadTexture(absPath("${MODULE_BLACKHOLE}/rendering/accretion_disk.png"), 1);
|
||||
|
||||
if (_accretionDiskTexture) {
|
||||
_accretionDiskTexture->uploadTexture();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderableBlackHole::bindFramebuffer() {
|
||||
|
||||
@@ -79,11 +79,12 @@ namespace openspace {
|
||||
GLuint _ssboStarKDTree = 0;
|
||||
GLuint _ssboStarKDTreeIndices = 0;
|
||||
|
||||
UniformCache(environmentTexture, viewGrid, worldRotationMatrix, cameraRotationMatrix, colorBVMap, r_0) _uniformCache;
|
||||
UniformCache(environmentTexture, viewGrid, worldRotationMatrix, cameraRotationMatrix, colorBVMap, r_0, accretionDisk) _uniformCache;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::Texture> _warpTableTex;
|
||||
std::unique_ptr<ghoul::opengl::Texture> _environmentTexture;
|
||||
std::unique_ptr<ghoul::opengl::Texture> _colorBVMapTexture;
|
||||
std::unique_ptr<ghoul::opengl::Texture> _accretionDiskTexture;
|
||||
};
|
||||
|
||||
} // openspace namespace
|
||||
|
||||
@@ -10,6 +10,7 @@ in vec2 TexCoord;
|
||||
|
||||
uniform sampler2D environmentTexture;
|
||||
uniform sampler2D viewGrid;
|
||||
uniform sampler1D accretionDisk;
|
||||
|
||||
uniform mat4 cameraRotationMatrix;
|
||||
uniform mat4 worldRotationMatrix;
|
||||
@@ -184,7 +185,7 @@ Fragment getFragment() {
|
||||
frag.color = vec4(0.0f);
|
||||
return frag;
|
||||
} else if(sphericalCoords.x == DISK){
|
||||
frag.color = vec4(clamp(sphericalCoords.y, 0.0, 1.0), 0.3*clamp(sphericalCoords.y, 0.0, 1.0), 0.15*clamp(sphericalCoords.y, 0.0, 1.0), 1.0f);
|
||||
frag.color = vec4(texture(accretionDisk, sphericalCoords.y).rgb, 1.0f);
|
||||
return frag;
|
||||
}
|
||||
vec4 starColor = searchNearestStar(vec3(0.0f, sphericalCoords.x, sphericalCoords.y), l);
|
||||
|
||||
Reference in New Issue
Block a user