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

0027633: Visualization, TKOpenGl - point sprites are inconsistent within Core and Compatible Profiles

OpenGl_ShaderManager::pointSpriteAlphaSrc() now does not return alpha from Red channel
for RGBA marker texture in Core profile.
OpenGl_ShaderManager::prepareStdProgramFlat() - restored code for drawing points without texture.

Built-in GLSL programs now flip .y in shaders instead of
relying on GL_POINT_SPRITE_COORD_ORIGIN unavailable on OpenGL ES.

Added sample markers.tcl (moved from test cases).
Sample now includes marker_kr.png for testing marker orientation.
This commit is contained in:
kgv
2016-06-24 11:36:57 +03:00
committed by bugmaster
parent 1d92133e83
commit fd59283a7b
14 changed files with 184 additions and 157 deletions

View File

@@ -138,8 +138,10 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
myIsStereoBuffers (Standard_False),
myIsGlNormalizeEnabled (Standard_False),
#if !defined(GL_ES_VERSION_2_0)
myPointSpriteOrig (GL_UPPER_LEFT),
myRenderMode (GL_RENDER),
#else
myPointSpriteOrig (0),
myRenderMode (0),
#endif
myReadBuffer (0),
@@ -2742,6 +2744,27 @@ void OpenGl_Context::SetPointSize (const Standard_ShortReal theSize)
#endif
}
// =======================================================================
// function : SetPointSpriteOrigin
// purpose :
// =======================================================================
void OpenGl_Context::SetPointSpriteOrigin()
{
#if !defined(GL_ES_VERSION_2_0)
if (core15fwd == NULL)
{
return;
}
const int aNewState = !myActiveProgram.IsNull() ? GL_UPPER_LEFT : GL_LOWER_LEFT;
if (myPointSpriteOrig != aNewState)
{
myPointSpriteOrig = aNewState;
core15fwd->glPointParameteri (GL_POINT_SPRITE_COORD_ORIGIN, aNewState);
}
#endif
}
// =======================================================================
// function : SetGlNormalizeEnabled
// purpose :