1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0030571: Visualization, TKOpenGl - mapped texture is ignored while drawing points

OpenGl_AspectsTextureSet now appends Sprite texture to the end of texture set.
OpenGl_Context::init() - fixed usage of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS on too old GL context.

Default sampler names occSampler0, occActiveSampler and occSamplerBaseColor
are now excluded from header with common declarations for build-in GLSL programs.

OpenGl_ShaderObject::LoadAndCompile() and OpenGl_ShaderProgram::Link()
now includes program Id within error log.

OpenGl_ShaderManager now supports mapping texture onto point primitive within built-in programs
(texture transformation is ignored).
This commit is contained in:
kgv
2019-03-16 16:47:33 +03:00
committed by apn
parent ad4b04291f
commit 737e9a8da4
28 changed files with 625 additions and 264 deletions

View File

@@ -141,22 +141,11 @@ public:
}
//! Bind program for point rendering
Standard_Boolean BindMarkerProgram (const Handle(OpenGl_TextureSet)& theTextures,
const Graphic3d_TypeOfShadingModel theShadingModel,
const Graphic3d_AlphaMode theAlphaMode,
const Standard_Boolean theHasVertColor,
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
{
if (!theCustomProgram.IsNull()
|| myContext->caps->ffpEnable)
{
return bindProgramWithState (theCustomProgram);
}
const Standard_Integer aBits = getProgramBits (theTextures, theAlphaMode, Aspect_IS_SOLID, theHasVertColor, false, false) | OpenGl_PO_Point;
Handle(OpenGl_ShaderProgram)& aProgram = getStdProgram (theShadingModel, aBits);
return bindProgramWithState (aProgram);
}
Standard_EXPORT Standard_Boolean BindMarkerProgram (const Handle(OpenGl_TextureSet)& theTextures,
Graphic3d_TypeOfShadingModel theShadingModel,
Graphic3d_AlphaMode theAlphaMode,
Standard_Boolean theHasVertColor,
const Handle(OpenGl_ShaderProgram)& theCustomProgram);
//! Bind program for rendering alpha-textured font.
Standard_Boolean BindFontProgram (const Handle(OpenGl_ShaderProgram)& theCustomProgram)
@@ -510,10 +499,9 @@ protected:
aBits |= OpenGl_PO_TextureEnv;
}
else if (!theTextures.IsNull()
&& !theTextures->IsEmpty()
&& !theTextures->First().IsNull())
&& theTextures->HasNonPointSprite())
{
aBits |= theTextures->First()->IsAlpha() ? OpenGl_PO_TextureA : OpenGl_PO_TextureRGB;
aBits |= OpenGl_PO_TextureRGB;
}
if (theHasVertColor
&& theInteriorStyle != Aspect_IS_HIDDENLINE)
@@ -554,10 +542,11 @@ protected:
}
//! Prepare standard GLSL program for accessing point sprite alpha.
Standard_EXPORT TCollection_AsciiString pointSpriteAlphaSrc (const Standard_Integer theBits);
Standard_EXPORT TCollection_AsciiString pointSpriteAlphaSrc (Standard_Integer theBits);
//! Prepare standard GLSL program for computing point sprite shading.
Standard_EXPORT TCollection_AsciiString pointSpriteShadingSrc (const TCollection_AsciiString theBaseColorSrc, const Standard_Integer theBits);
Standard_EXPORT TCollection_AsciiString pointSpriteShadingSrc (const TCollection_AsciiString& theBaseColorSrc,
Standard_Integer theBits);
//! Prepare standard GLSL program for textured font.
Standard_EXPORT Standard_Boolean prepareStdProgramFont();