mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Add base texture or color to ModelProjection
This commit is contained in:
@@ -344,7 +344,7 @@ void RenderableModelProjection::imageProjectGPU(
|
||||
_transform
|
||||
);
|
||||
|
||||
_geometry->render(*_fboProgramObject, false);
|
||||
_geometry->render(*_fboProgramObject, false, true);
|
||||
|
||||
_depthFboProgramObject->deactivate();
|
||||
_projectionComponent.depthMapRenderEnd();
|
||||
@@ -374,7 +374,7 @@ void RenderableModelProjection::imageProjectGPU(
|
||||
_fboProgramObject->setUniform(_fboUniformCache.ModelTransform, _transform);
|
||||
_fboProgramObject->setUniform(_fboUniformCache.boresight, _boresight);
|
||||
|
||||
_geometry->render(*_fboProgramObject, false);
|
||||
_geometry->render(*_fboProgramObject, false, true);
|
||||
|
||||
_fboProgramObject->deactivate();
|
||||
_projectionComponent.imageProjectEnd();
|
||||
|
||||
@@ -30,7 +30,9 @@ in vec3 vs_normalViewSpace;
|
||||
in float vs_depth;
|
||||
in vec4 vs_positionCameraSpace;
|
||||
|
||||
uniform bool has_texture_diffuse;
|
||||
uniform sampler2D baseTexture;
|
||||
uniform vec3 baseColor;
|
||||
uniform sampler2D projectionTexture;
|
||||
uniform bool performShading;
|
||||
uniform float projectionFading;
|
||||
@@ -44,7 +46,13 @@ const float specularIntensity = 0.0;
|
||||
const float specularPower = 100.0;
|
||||
|
||||
Fragment getFragment() {
|
||||
vec4 textureColor = texture(baseTexture, vs_st);
|
||||
vec4 textureColor;
|
||||
if (has_texture_diffuse) {
|
||||
textureColor = texture(baseTexture, vs_st);
|
||||
}
|
||||
else {
|
||||
textureColor.rgb = baseColor;
|
||||
}
|
||||
vec4 projectionColor = texture(projectionTexture, vs_st);
|
||||
if (projectionColor.a > 0.0) {
|
||||
textureColor.rgb = mix(
|
||||
|
||||
Reference in New Issue
Block a user