@ -144,7 +144,7 @@ void MeshVisualizerGLBase::assertExtensions(const FlagsBase flags) {
# ifdef MAGNUM_BUILD_STATIC
# ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
/* Import resources on static build, if not already */
if ( ! Utility : : Resource : : hasGroup ( " MagnumShadersGL " ) )
if ( ! Utility : : Resource : : hasGroup ( " MagnumShadersGL " _s ) )
importShaderResources ( ) ;
importShaderResources ( ) ;
# endif
# endif
}
}
@ -176,24 +176,24 @@ GL::Version MeshVisualizerGLBase::setupShaders(GL::Shader& vert, GL::Shader& fra
vert = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Vertex ) ;
vert = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Vertex ) ;
frag = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Fragment ) ;
frag = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Fragment ) ;
vert . addSource ( flags & FlagBase : : Wireframe ? " #define WIREFRAME_RENDERING \n " : " " )
vert . addSource ( flags & FlagBase : : Wireframe ? " #define WIREFRAME_RENDERING \n " _s : " " _s )
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
. addSource ( flags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " : " " )
. addSource ( flags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " _s : " " _s )
. addSource ( flags & FlagBase : : TextureTransformation ? " #define TEXTURE_TRANSFORMATION \n " : " " )
. addSource ( flags & FlagBase : : TextureTransformation ? " #define TEXTURE_TRANSFORMATION \n " _s : " " _s )
. addSource ( flags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " : " " )
. addSource ( flags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " _s : " " _s )
. addSource ( flags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " : " " )
. addSource ( flags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " _s : " " _s )
# endif
# endif
. addSource ( flags & FlagBase : : InstancedTransformation ? " #define INSTANCED_TRANSFORMATION \n " : " " )
. addSource ( flags & FlagBase : : InstancedTransformation ? " #define INSTANCED_TRANSFORMATION \n " _s : " " _s )
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
. addSource ( flags > = FlagBase : : InstancedTextureOffset ? " #define INSTANCED_TEXTURE_OFFSET \n " : " " )
. addSource ( flags > = FlagBase : : InstancedTextureOffset ? " #define INSTANCED_TEXTURE_OFFSET \n " _s : " " _s )
. addSource ( flags & FlagBase : : VertexId ? " #define VERTEX_ID \n " : " " )
. addSource ( flags & FlagBase : : VertexId ? " #define VERTEX_ID \n " _s : " " _s )
. addSource ( flags > = FlagBase : : PrimitiveIdFromVertexId ? " #define PRIMITIVE_ID_FROM_VERTEX_ID \n " : " " )
. addSource ( flags > = FlagBase : : PrimitiveIdFromVertexId ? " #define PRIMITIVE_ID_FROM_VERTEX_ID \n " _s : " " _s )
# endif
# endif
# ifdef MAGNUM_TARGET_WEBGL
# ifdef MAGNUM_TARGET_WEBGL
. addSource ( " #define SUBSCRIPTING_WORKAROUND \n " )
. addSource ( " #define SUBSCRIPTING_WORKAROUND \n " _s )
# elif defined(MAGNUM_TARGET_GLES2)
# elif defined(MAGNUM_TARGET_GLES2)
. addSource ( context . detectedDriver ( ) & GL : : Context : : DetectedDriver : : Angle ?
. addSource ( context . detectedDriver ( ) & GL : : Context : : DetectedDriver : : Angle ?
" #define SUBSCRIPTING_WORKAROUND \n " : " " )
" #define SUBSCRIPTING_WORKAROUND \n " _s : " " _s )
# endif
# endif
;
;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
@ -229,20 +229,20 @@ GL::Version MeshVisualizerGLBase::setupShaders(GL::Shader& vert, GL::Shader& fra
" #define MATERIAL_COUNT {} \n " ,
" #define MATERIAL_COUNT {} \n " ,
drawCount ,
drawCount ,
materialCount ) ) ;
materialCount ) ) ;
vert . addSource ( flags > = FlagBase : : MultiDraw ? " #define MULTI_DRAW \n " : " " ) ;
vert . addSource ( flags > = FlagBase : : MultiDraw ? " #define MULTI_DRAW \n " _s : " " _s ) ;
}
}
# endif
# endif
frag . addSource ( flags & FlagBase : : Wireframe ? " #define WIREFRAME_RENDERING \n " : " " )
frag . addSource ( flags & FlagBase : : Wireframe ? " #define WIREFRAME_RENDERING \n " _s : " " _s )
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
. addSource ( flags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " : " " )
. addSource ( flags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " _s : " " _s )
. addSource ( flags > = FlagBase : : ObjectIdTexture ? " #define OBJECT_ID_TEXTURE \n " : " " )
. addSource ( flags > = FlagBase : : ObjectIdTexture ? " #define OBJECT_ID_TEXTURE \n " _s : " " _s )
. addSource ( flags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " : " " )
. addSource ( flags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " _s : " " _s )
. addSource ( flags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " : " " )
. addSource ( flags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " _s : " " _s )
. addSource ( flags & FlagBase : : VertexId ? " #define VERTEX_ID \n " : " " )
. addSource ( flags & FlagBase : : VertexId ? " #define VERTEX_ID \n " _s : " " _s )
. addSource ( flags & FlagBase : : PrimitiveId ?
. addSource ( flags & FlagBase : : PrimitiveId ?
( flags > = FlagBase : : PrimitiveIdFromVertexId ?
( flags > = FlagBase : : PrimitiveIdFromVertexId ?
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " :
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " _s :
" #define PRIMITIVE_ID \n " ) : " " )
" #define PRIMITIVE_ID \n " _s ) : " " _s )
# endif
# endif
;
;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
@ -253,7 +253,7 @@ GL::Version MeshVisualizerGLBase::setupShaders(GL::Shader& vert, GL::Shader& fra
" #define MATERIAL_COUNT {} \n " ,
" #define MATERIAL_COUNT {} \n " ,
drawCount ,
drawCount ,
materialCount ) ) ;
materialCount ) ) ;
frag . addSource ( flags > = FlagBase : : MultiDraw ? " #define MULTI_DRAW \n " : " " ) ;
frag . addSource ( flags > = FlagBase : : MultiDraw ? " #define MULTI_DRAW \n " _s : " " _s ) ;
}
}
# endif
# endif
@ -503,42 +503,42 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Configuration
) ;
) ;
Containers : : Optional < GL : : Shader > geom ;
Containers : : Optional < GL : : Shader > geom ;
vert . addSource ( " #define TWO_DIMENSIONS \n " )
vert . addSource ( " #define TWO_DIMENSIONS \n " _s )
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
nothing actually needs it , as that makes checks much simpler in
nothing actually needs it , as that makes checks much simpler in
the shader code */
the shader code */
. addSource ( ( configuration . flags ( ) & Flag : : NoGeometryShader ) | | ! ( configuration . flags ( ) & Flag : : Wireframe ) ?
. addSource ( ( configuration . flags ( ) & Flag : : NoGeometryShader ) | | ! ( configuration . flags ( ) & Flag : : Wireframe ) ?
" #define NO_GEOMETRY_SHADER \n " : " " )
" #define NO_GEOMETRY_SHADER \n " _s : " " _s )
. addSource ( rs . getString ( " generic.glsl " ) )
. addSource ( rs . getString ( " generic.glsl " _s ) )
. addSource ( rs . getString ( " MeshVisualizer.vert " ) ) ;
. addSource ( rs . getString ( " MeshVisualizer.vert " _s ) ) ;
frag
frag
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
nothing actually needs it , as that makes checks much simpler in
nothing actually needs it , as that makes checks much simpler in
the shader code */
the shader code */
. addSource ( ( configuration . flags ( ) & Flag : : NoGeometryShader ) | | ! ( configuration . flags ( ) & Flag : : Wireframe ) ?
. addSource ( ( configuration . flags ( ) & Flag : : NoGeometryShader ) | | ! ( configuration . flags ( ) & Flag : : Wireframe ) ?
" #define NO_GEOMETRY_SHADER \n " : " " ) ;
" #define NO_GEOMETRY_SHADER \n " _s : " " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : UniformBuffers )
if ( configuration . flags ( ) > = Flag : : UniformBuffers )
frag . addSource ( " #define TWO_DIMENSIONS \n " ) ;
frag . addSource ( " #define TWO_DIMENSIONS \n " _s ) ;
# endif
# endif
frag . addSource ( rs . getString ( " generic.glsl " ) )
frag . addSource ( rs . getString ( " generic.glsl " _s ) )
. addSource ( rs . getString ( " MeshVisualizer.frag " ) ) ;
. addSource ( rs . getString ( " MeshVisualizer.frag " _s ) ) ;
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if ( configuration . flags ( ) & Flag : : Wireframe & & ! ( configuration . flags ( ) & Flag : : NoGeometryShader ) ) {
if ( configuration . flags ( ) & Flag : : Wireframe & & ! ( configuration . flags ( ) & Flag : : NoGeometryShader ) ) {
geom = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Geometry ) ;
geom = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Geometry ) ;
( * geom )
( * geom )
. addSource ( " #define WIREFRAME_RENDERING \n #define MAX_VERTICES 3 \n " )
. addSource ( " #define WIREFRAME_RENDERING \n #define MAX_VERTICES 3 \n " _s )
. addSource ( baseFlags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " : " " )
. addSource ( baseFlags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " : " " )
. addSource ( baseFlags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " : " " )
. addSource ( baseFlags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " _s : " " _s )
. addSource ( baseFlags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " : " " )
. addSource ( baseFlags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : VertexId ? " #define VERTEX_ID \n " : " " )
. addSource ( baseFlags & FlagBase : : VertexId ? " #define VERTEX_ID \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : PrimitiveId ?
. addSource ( baseFlags & FlagBase : : PrimitiveId ?
( baseFlags > = FlagBase : : PrimitiveIdFromVertexId ?
( baseFlags > = FlagBase : : PrimitiveIdFromVertexId ?
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " :
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " _s :
" #define PRIMITIVE_ID \n " ) : " " ) ;
" #define PRIMITIVE_ID \n " _s ) : " " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : UniformBuffers ) {
if ( configuration . flags ( ) > = Flag : : UniformBuffers ) {
geom - > addSource ( Utility : : format (
geom - > addSource ( Utility : : format (
@ -548,10 +548,10 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Configuration
" #define MATERIAL_COUNT {} \n " ,
" #define MATERIAL_COUNT {} \n " ,
configuration . drawCount ( ) ,
configuration . drawCount ( ) ,
configuration . materialCount ( ) ) ) ;
configuration . materialCount ( ) ) ) ;
geom - > addSource ( configuration . flags ( ) > = Flag : : MultiDraw ? " #define MULTI_DRAW \n " : " " ) ;
geom - > addSource ( configuration . flags ( ) > = Flag : : MultiDraw ? " #define MULTI_DRAW \n " _s : " " _s ) ;
}
}
# endif
# endif
geom - > addSource ( rs . getString ( " MeshVisualizer.geom " ) ) ;
geom - > addSource ( rs . getString ( " MeshVisualizer.geom " _s ) ) ;
}
}
# else
# else
static_cast < void > ( version ) ;
static_cast < void > ( version ) ;
@ -571,25 +571,25 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Configuration
if ( ! context . isExtensionSupported < GL : : Extensions : : ARB : : explicit_attrib_location > ( version ) )
if ( ! context . isExtensionSupported < GL : : Extensions : : ARB : : explicit_attrib_location > ( version ) )
# endif
# endif
{
{
out . bindAttributeLocation ( Position : : Location , " position " ) ;
out . bindAttributeLocation ( Position : : Location , " position " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : ObjectIdTexture )
if ( configuration . flags ( ) > = Flag : : ObjectIdTexture )
out . bindAttributeLocation ( TextureCoordinates : : Location , " textureCoordinates " ) ;
out . bindAttributeLocation ( TextureCoordinates : : Location , " textureCoordinates " _s ) ;
if ( configuration . flags ( ) > = Flag : : InstancedObjectId )
if ( configuration . flags ( ) > = Flag : : InstancedObjectId )
out . bindAttributeLocation ( ObjectId : : Location , " instanceObjectId " ) ;
out . bindAttributeLocation ( ObjectId : : Location , " instanceObjectId " _s ) ;
# endif
# endif
if ( configuration . flags ( ) & Flag : : InstancedTransformation )
if ( configuration . flags ( ) & Flag : : InstancedTransformation )
out . bindAttributeLocation ( TransformationMatrix : : Location , " instancedTransformationMatrix " ) ;
out . bindAttributeLocation ( TransformationMatrix : : Location , " instancedTransformationMatrix " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : InstancedTextureOffset )
if ( configuration . flags ( ) > = Flag : : InstancedTextureOffset )
out . bindAttributeLocation ( TextureOffset : : Location , " instancedTextureOffset " ) ;
out . bindAttributeLocation ( TextureOffset : : Location , " instancedTextureOffset " _s ) ;
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
# if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! context . isVersionSupported ( GL : : Version : : GL310 ) )
if ( ! context . isVersionSupported ( GL : : Version : : GL310 ) )
# endif
# endif
{
{
out . bindAttributeLocation ( VertexIndex : : Location , " vertexIndex " ) ;
out . bindAttributeLocation ( VertexIndex : : Location , " vertexIndex " _s ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
@ -597,12 +597,12 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Configuration
perVertexJointCount / secondaryPerVertexJointCount are either all
perVertexJointCount / secondaryPerVertexJointCount are either all
zero or non - zero so we don ' t need to check for jointCount ( ) here */
zero or non - zero so we don ' t need to check for jointCount ( ) here */
if ( configuration . perVertexJointCount ( ) ) {
if ( configuration . perVertexJointCount ( ) ) {
out . bindAttributeLocation ( Weights : : Location , " weights " ) ;
out . bindAttributeLocation ( Weights : : Location , " weights " _s ) ;
out . bindAttributeLocation ( JointIds : : Location , " jointIds " ) ;
out . bindAttributeLocation ( JointIds : : Location , " jointIds " _s ) ;
}
}
if ( configuration . secondaryPerVertexJointCount ( ) ) {
if ( configuration . secondaryPerVertexJointCount ( ) ) {
out . bindAttributeLocation ( SecondaryWeights : : Location , " secondaryWeights " ) ;
out . bindAttributeLocation ( SecondaryWeights : : Location , " secondaryWeights " _s ) ;
out . bindAttributeLocation ( SecondaryJointIds : : Location , " secondaryJointIds " ) ;
out . bindAttributeLocation ( SecondaryJointIds : : Location , " secondaryJointIds " _s ) ;
}
}
# endif
# endif
}
}
@ -660,45 +660,45 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D
/* This one is used also in the UBO case as it's usually a global
/* This one is used also in the UBO case as it's usually a global
setting */
setting */
if ( ( flags ( ) & Flag : : Wireframe ) & & ! ( flags ( ) & Flag : : NoGeometryShader ) )
if ( ( flags ( ) & Flag : : Wireframe ) & & ! ( flags ( ) & Flag : : NoGeometryShader ) )
_viewportSizeUniform = uniformLocation ( " viewportSize " ) ;
_viewportSizeUniform = uniformLocation ( " viewportSize " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) > = Flag : : DynamicPerVertexJointCount )
if ( flags ( ) > = Flag : : DynamicPerVertexJointCount )
_perVertexJointCountUniform = uniformLocation ( " perVertexJointCount " ) ;
_perVertexJointCountUniform = uniformLocation ( " perVertexJointCount " _s ) ;
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( _drawCount > 1 ) _drawOffsetUniform = uniformLocation ( " drawOffset " ) ;
if ( _drawCount > 1 ) _drawOffsetUniform = uniformLocation ( " drawOffset " _s ) ;
} else
} else
# endif
# endif
{
{
_transformationProjectionMatrixUniform = uniformLocation ( " transformationProjectionMatrix " ) ;
_transformationProjectionMatrixUniform = uniformLocation ( " transformationProjectionMatrix " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) & Flag : : TextureTransformation )
if ( flags ( ) & Flag : : TextureTransformation )
_textureMatrixUniform = uniformLocation ( " textureMatrix " ) ;
_textureMatrixUniform = uniformLocation ( " textureMatrix " _s ) ;
if ( flags ( ) & Flag : : TextureArrays )
if ( flags ( ) & Flag : : TextureArrays )
_textureLayerUniform = uniformLocation ( " textureLayer " ) ;
_textureLayerUniform = uniformLocation ( " textureLayer " _s ) ;
# endif
# endif
if ( flags ( ) & ( Flag : : Wireframe
if ( flags ( ) & ( Flag : : Wireframe
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
| Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId
| Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId
# endif
# endif
) )
) )
_colorUniform = uniformLocation ( " color " ) ;
_colorUniform = uniformLocation ( " color " _s ) ;
if ( flags ( ) & Flag : : Wireframe ) {
if ( flags ( ) & Flag : : Wireframe ) {
_wireframeColorUniform = uniformLocation ( " wireframeColor " ) ;
_wireframeColorUniform = uniformLocation ( " wireframeColor " _s ) ;
_wireframeWidthUniform = uniformLocation ( " wireframeWidth " ) ;
_wireframeWidthUniform = uniformLocation ( " wireframeWidth " _s ) ;
_smoothnessUniform = uniformLocation ( " smoothness " ) ;
_smoothnessUniform = uniformLocation ( " smoothness " _s ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
_colorMapOffsetScaleUniform = uniformLocation ( " colorMapOffsetScale " ) ;
_colorMapOffsetScaleUniform = uniformLocation ( " colorMapOffsetScale " _s ) ;
}
}
if ( flags ( ) & Flag : : ObjectId )
if ( flags ( ) & Flag : : ObjectId )
_objectIdUniform = uniformLocation ( " objectId " ) ;
_objectIdUniform = uniformLocation ( " objectId " _s ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( _jointCount ) {
if ( _jointCount ) {
_jointMatricesUniform = uniformLocation ( " jointMatrices " ) ;
_jointMatricesUniform = uniformLocation ( " jointMatrices " _s ) ;
_perInstanceJointCountUniform = uniformLocation ( " perInstanceJointCount " ) ;
_perInstanceJointCountUniform = uniformLocation ( " perInstanceJointCount " _s ) ;
}
}
# endif
# endif
}
}
@ -710,19 +710,19 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D
# endif
# endif
{
{
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
setUniform ( uniformLocation ( " colorMapTexture " ) , ColorMapTextureUnit ) ;
setUniform ( uniformLocation ( " colorMapTexture " _s ) , ColorMapTextureUnit ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) > = Flag : : ObjectIdTexture )
if ( flags ( ) > = Flag : : ObjectIdTexture )
setUniform ( uniformLocation ( " objectIdTextureData " ) , ObjectIdTextureUnit ) ;
setUniform ( uniformLocation ( " objectIdTextureData " _s ) , ObjectIdTextureUnit ) ;
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( flags ( ) > = Flag : : UniformBuffers ) {
setUniformBlockBinding ( uniformBlockIndex ( " TransformationProjection " ) , TransformationProjectionBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " TransformationProjection " _s ) , TransformationProjectionBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Draw " ) , DrawBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Draw " _s ) , DrawBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Material " ) , MaterialBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Material " _s ) , MaterialBufferBinding ) ;
if ( flags ( ) & Flag : : TextureTransformation )
if ( flags ( ) & Flag : : TextureTransformation )
setUniformBlockBinding ( uniformBlockIndex ( " TextureTransformation " ) , TextureTransformationBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " TextureTransformation " _s ) , TextureTransformationBufferBinding ) ;
if ( _jointCount )
if ( _jointCount )
setUniformBlockBinding ( uniformBlockIndex ( " Joint " ) , JointBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Joint " _s ) , JointBufferBinding ) ;
}
}
# endif
# endif
}
}
@ -955,7 +955,7 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
CORRADE_INTERNAL_ASSERT ( ! ( configuration . flags ( ) & ( Flag : : NormalDirection | Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection ) ) | | version > = GL : : Version : : GLES310 ) ;
CORRADE_INTERNAL_ASSERT ( ! ( configuration . flags ( ) & ( Flag : : NormalDirection | Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection ) ) | | version > = GL : : Version : : GLES310 ) ;
# endif
# endif
vert . addSource ( " #define THREE_DIMENSIONS \n " )
vert . addSource ( " #define THREE_DIMENSIONS \n " _s )
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
nothing actually needs it , as that makes checks much simpler in
nothing actually needs it , as that makes checks much simpler in
the vertex shader code */
the vertex shader code */
@ -963,16 +963,16 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
| Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection | Flag : : NormalDirection
| Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection | Flag : : NormalDirection
# endif
# endif
) ) ? " #define NO_GEOMETRY_SHADER \n " : " " )
) ) ? " #define NO_GEOMETRY_SHADER \n " _s : " " _s )
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
. addSource ( configuration . flags ( ) & Flag : : TangentDirection ? " #define TANGENT_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : TangentDirection ? " #define TANGENT_DIRECTION \n " _s : " " _s )
. addSource ( configuration . flags ( ) & Flag : : BitangentFromTangentDirection ? " #define BITANGENT_FROM_TANGENT_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : BitangentFromTangentDirection ? " #define BITANGENT_FROM_TANGENT_DIRECTION \n " _s : " " _s )
. addSource ( configuration . flags ( ) & Flag : : BitangentDirection ? " #define BITANGENT_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : BitangentDirection ? " #define BITANGENT_DIRECTION \n " _s : " " _s )
. addSource ( configuration . flags ( ) & Flag : : NormalDirection ? " #define NORMAL_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : NormalDirection ? " #define NORMAL_DIRECTION \n " _s : " " _s )
# endif
# endif
;
;
vert . addSource ( rs . getString ( " generic.glsl " ) )
vert . addSource ( rs . getString ( " generic.glsl " _s ) )
. addSource ( rs . getString ( " MeshVisualizer.vert " ) ) ;
. addSource ( rs . getString ( " MeshVisualizer.vert " _s ) ) ;
frag
frag
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
/* Pass NO_GEOMETRY_SHADER not only when NoGeometryShader but also when
nothing actually needs it , as that makes checks much simpler in
nothing actually needs it , as that makes checks much simpler in
@ -981,17 +981,17 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
| Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection | Flag : : NormalDirection
| Flag : : TangentDirection | Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection | Flag : : NormalDirection
# endif
# endif
) ) ? " #define NO_GEOMETRY_SHADER \n " : " " )
) ) ? " #define NO_GEOMETRY_SHADER \n " _s : " " _s )
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
. addSource ( configuration . flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) ? " #define TBN_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) ? " #define TBN_DIRECTION \n " _s : " " _s )
# endif
# endif
;
;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : UniformBuffers )
if ( configuration . flags ( ) > = Flag : : UniformBuffers )
frag . addSource ( " #define THREE_DIMENSIONS \n " ) ;
frag . addSource ( " #define THREE_DIMENSIONS \n " _s ) ;
# endif
# endif
frag . addSource ( rs . getString ( " generic.glsl " ) )
frag . addSource ( rs . getString ( " generic.glsl " _s ) )
. addSource ( rs . getString ( " MeshVisualizer.frag " ) ) ;
. addSource ( rs . getString ( " MeshVisualizer.frag " _s ) ) ;
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if ( configuration . flags ( ) & ( Flag : : Wireframe | Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) & & ! ( configuration . flags ( ) & Flag : : NoGeometryShader ) ) {
if ( configuration . flags ( ) & ( Flag : : Wireframe | Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) & & ! ( configuration . flags ( ) & Flag : : NoGeometryShader ) ) {
@ -1005,19 +1005,19 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
geom = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Geometry ) ;
geom = Implementation : : createCompatibilityShader ( rs , version , GL : : Shader : : Type : : Geometry ) ;
( * geom )
( * geom )
. addSource ( Utility : : format ( " #define MAX_VERTICES {} \n " , maxVertices ) )
. addSource ( Utility : : format ( " #define MAX_VERTICES {} \n " , maxVertices ) )
. addSource ( configuration . flags ( ) & Flag : : Wireframe ? " #define WIREFRAME_RENDERING \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : Wireframe ? " #define WIREFRAME_RENDERING \n " _s : " " _s )
. addSource ( baseFlags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " : " " )
. addSource ( baseFlags > = FlagBase : : ObjectIdTexture ? " #define TEXTURED \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " : " " )
. addSource ( baseFlags & FlagBase : : TextureArrays ? " #define TEXTURE_ARRAYS \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " : " " )
. addSource ( baseFlags & FlagBase : : ObjectId ? " #define OBJECT_ID \n " _s : " " _s )
. addSource ( baseFlags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " : " " )
. addSource ( baseFlags > = FlagBase : : InstancedObjectId ? " #define INSTANCED_OBJECT_ID \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : VertexId ? " #define VERTEX_ID \n " : " " )
. addSource ( baseFlags & FlagBase : : VertexId ? " #define VERTEX_ID \n " _s : " " _s )
. addSource ( baseFlags & FlagBase : : PrimitiveId ?
. addSource ( baseFlags & FlagBase : : PrimitiveId ?
( baseFlags > = FlagBase : : PrimitiveIdFromVertexId ?
( baseFlags > = FlagBase : : PrimitiveIdFromVertexId ?
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " :
" #define PRIMITIVE_ID_FROM_VERTEX_ID \n " _s :
" #define PRIMITIVE_ID \n " ) : " " )
" #define PRIMITIVE_ID \n " _s ) : " " _s )
. addSource ( configuration . flags ( ) & Flag : : TangentDirection ? " #define TANGENT_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & Flag : : TangentDirection ? " #define TANGENT_DIRECTION \n " _s : " " _s )
. addSource ( configuration . flags ( ) & ( Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection ) ? " #define BITANGENT_DIRECTION \n " : " " )
. addSource ( configuration . flags ( ) & ( Flag : : BitangentDirection | Flag : : BitangentFromTangentDirection ) ? " #define BITANGENT_DIRECTION \n " _s : " " _s )
. addSource ( configuration . flags ( ) & Flag : : NormalDirection ? " #define NORMAL_DIRECTION \n " : " " ) ;
. addSource ( configuration . flags ( ) & Flag : : NormalDirection ? " #define NORMAL_DIRECTION \n " _s : " " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : UniformBuffers ) {
if ( configuration . flags ( ) > = Flag : : UniformBuffers ) {
geom - > addSource ( Utility : : format (
geom - > addSource ( Utility : : format (
@ -1027,10 +1027,10 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
" #define MATERIAL_COUNT {} \n " ,
" #define MATERIAL_COUNT {} \n " ,
configuration . drawCount ( ) ,
configuration . drawCount ( ) ,
configuration . materialCount ( ) ) ) ;
configuration . materialCount ( ) ) ) ;
geom - > addSource ( configuration . flags ( ) > = Flag : : MultiDraw ? " #define MULTI_DRAW \n " : " " ) ;
geom - > addSource ( configuration . flags ( ) > = Flag : : MultiDraw ? " #define MULTI_DRAW \n " _s : " " _s ) ;
}
}
# endif
# endif
geom - > addSource ( rs . getString ( " MeshVisualizer.geom " ) ) ;
geom - > addSource ( rs . getString ( " MeshVisualizer.geom " _s ) ) ;
}
}
# else
# else
static_cast < void > ( version ) ;
static_cast < void > ( version ) ;
@ -1050,40 +1050,40 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
if ( ! context . isExtensionSupported < GL : : Extensions : : ARB : : explicit_attrib_location > ( version ) )
if ( ! context . isExtensionSupported < GL : : Extensions : : ARB : : explicit_attrib_location > ( version ) )
# endif
# endif
{
{
out . bindAttributeLocation ( Position : : Location , " position " ) ;
out . bindAttributeLocation ( Position : : Location , " position " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : ObjectIdTexture )
if ( configuration . flags ( ) > = Flag : : ObjectIdTexture )
out . bindAttributeLocation ( TextureCoordinates : : Location , " textureCoordinates " ) ;
out . bindAttributeLocation ( TextureCoordinates : : Location , " textureCoordinates " _s ) ;
if ( configuration . flags ( ) > = Flag : : InstancedObjectId )
if ( configuration . flags ( ) > = Flag : : InstancedObjectId )
out . bindAttributeLocation ( ObjectId : : Location , " instanceObjectId " ) ;
out . bindAttributeLocation ( ObjectId : : Location , " instanceObjectId " _s ) ;
# endif
# endif
if ( configuration . flags ( ) & Flag : : InstancedTransformation ) {
if ( configuration . flags ( ) & Flag : : InstancedTransformation ) {
out . bindAttributeLocation ( TransformationMatrix : : Location , " instancedTransformationMatrix " ) ;
out . bindAttributeLocation ( TransformationMatrix : : Location , " instancedTransformationMatrix " _s ) ;
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if ( configuration . flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) )
if ( configuration . flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) )
out . bindAttributeLocation ( NormalMatrix : : Location , " instancedNormalMatrix " ) ;
out . bindAttributeLocation ( NormalMatrix : : Location , " instancedNormalMatrix " _s ) ;
# endif
# endif
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( configuration . flags ( ) > = Flag : : InstancedTextureOffset )
if ( configuration . flags ( ) > = Flag : : InstancedTextureOffset )
out . bindAttributeLocation ( TextureOffset : : Location , " instancedTextureOffset " ) ;
out . bindAttributeLocation ( TextureOffset : : Location , " instancedTextureOffset " _s ) ;
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if ( configuration . flags ( ) & Flag : : TangentDirection | |
if ( configuration . flags ( ) & Flag : : TangentDirection | |
configuration . flags ( ) & Flag : : BitangentFromTangentDirection )
configuration . flags ( ) & Flag : : BitangentFromTangentDirection )
out . bindAttributeLocation ( Tangent4 : : Location , " tangent " ) ;
out . bindAttributeLocation ( Tangent4 : : Location , " tangent " _s ) ;
if ( configuration . flags ( ) & Flag : : BitangentDirection )
if ( configuration . flags ( ) & Flag : : BitangentDirection )
out . bindAttributeLocation ( Bitangent : : Location , " bitangent " ) ;
out . bindAttributeLocation ( Bitangent : : Location , " bitangent " _s ) ;
if ( configuration . flags ( ) & Flag : : NormalDirection | |
if ( configuration . flags ( ) & Flag : : NormalDirection | |
configuration . flags ( ) & Flag : : BitangentFromTangentDirection )
configuration . flags ( ) & Flag : : BitangentFromTangentDirection )
out . bindAttributeLocation ( Normal : : Location , " normal " ) ;
out . bindAttributeLocation ( Normal : : Location , " normal " _s ) ;
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
# if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! context . isVersionSupported ( GL : : Version : : GL310 ) )
if ( ! context . isVersionSupported ( GL : : Version : : GL310 ) )
# endif
# endif
{
{
out . bindAttributeLocation ( VertexIndex : : Location , " vertexIndex " ) ;
out . bindAttributeLocation ( VertexIndex : : Location , " vertexIndex " _s ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
@ -1091,12 +1091,12 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration
perVertexJointCount / secondaryPerVertexJointCount are either all
perVertexJointCount / secondaryPerVertexJointCount are either all
zero or non - zero so we don ' t need to check for jointCount ( ) here */
zero or non - zero so we don ' t need to check for jointCount ( ) here */
if ( configuration . perVertexJointCount ( ) ) {
if ( configuration . perVertexJointCount ( ) ) {
out . bindAttributeLocation ( Weights : : Location , " weights " ) ;
out . bindAttributeLocation ( Weights : : Location , " weights " _s ) ;
out . bindAttributeLocation ( JointIds : : Location , " jointIds " ) ;
out . bindAttributeLocation ( JointIds : : Location , " jointIds " _s ) ;
}
}
if ( configuration . secondaryPerVertexJointCount ( ) ) {
if ( configuration . secondaryPerVertexJointCount ( ) ) {
out . bindAttributeLocation ( SecondaryWeights : : Location , " secondaryWeights " ) ;
out . bindAttributeLocation ( SecondaryWeights : : Location , " secondaryWeights " _s ) ;
out . bindAttributeLocation ( SecondaryJointIds : : Location , " secondaryJointIds " ) ;
out . bindAttributeLocation ( SecondaryJointIds : : Location , " secondaryJointIds " _s ) ;
}
}
# endif
# endif
}
}
@ -1158,59 +1158,59 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D
| | ( flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) )
| | ( flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) )
# endif
# endif
)
)
_viewportSizeUniform = uniformLocation ( " viewportSize " ) ;
_viewportSizeUniform = uniformLocation ( " viewportSize " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) > = Flag : : DynamicPerVertexJointCount )
if ( flags ( ) > = Flag : : DynamicPerVertexJointCount )
_perVertexJointCountUniform = uniformLocation ( " perVertexJointCount " ) ;
_perVertexJointCountUniform = uniformLocation ( " perVertexJointCount " _s ) ;
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( _drawCount > 1 ) _drawOffsetUniform = uniformLocation ( " drawOffset " ) ;
if ( _drawCount > 1 ) _drawOffsetUniform = uniformLocation ( " drawOffset " _s ) ;
} else
} else
# endif
# endif
{
{
_transformationMatrixUniform = uniformLocation ( " transformationMatrix " ) ;
_transformationMatrixUniform = uniformLocation ( " transformationMatrix " _s ) ;
_projectionMatrixUniform = uniformLocation ( " projectionMatrix " ) ;
_projectionMatrixUniform = uniformLocation ( " projectionMatrix " _s ) ;
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) & Flag : : TextureTransformation )
if ( flags ( ) & Flag : : TextureTransformation )
_textureMatrixUniform = uniformLocation ( " textureMatrix " ) ;
_textureMatrixUniform = uniformLocation ( " textureMatrix " _s ) ;
if ( flags ( ) & Flag : : TextureArrays )
if ( flags ( ) & Flag : : TextureArrays )
_textureLayerUniform = uniformLocation ( " textureLayer " ) ;
_textureLayerUniform = uniformLocation ( " textureLayer " _s ) ;
# endif
# endif
if ( flags ( ) & ( Flag : : Wireframe
if ( flags ( ) & ( Flag : : Wireframe
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
| Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId
| Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId
# endif
# endif
) )
) )
_colorUniform = uniformLocation ( " color " ) ;
_colorUniform = uniformLocation ( " color " _s ) ;
if ( flags ( ) & Flag : : Wireframe ) {
if ( flags ( ) & Flag : : Wireframe ) {
_wireframeColorUniform = uniformLocation ( " wireframeColor " ) ;
_wireframeColorUniform = uniformLocation ( " wireframeColor " _s ) ;
_wireframeWidthUniform = uniformLocation ( " wireframeWidth " ) ;
_wireframeWidthUniform = uniformLocation ( " wireframeWidth " _s ) ;
}
}
if ( flags ( ) & ( Flag : : Wireframe
if ( flags ( ) & ( Flag : : Wireframe
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
| Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection
| Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection
# endif
# endif
) ) {
) ) {
_smoothnessUniform = uniformLocation ( " smoothness " ) ;
_smoothnessUniform = uniformLocation ( " smoothness " _s ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
_colorMapOffsetScaleUniform = uniformLocation ( " colorMapOffsetScale " ) ;
_colorMapOffsetScaleUniform = uniformLocation ( " colorMapOffsetScale " _s ) ;
}
}
if ( flags ( ) & Flag : : ObjectId )
if ( flags ( ) & Flag : : ObjectId )
_objectIdUniform = uniformLocation ( " objectId " ) ;
_objectIdUniform = uniformLocation ( " objectId " _s ) ;
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if ( flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) ) {
if ( flags ( ) & ( Flag : : TangentDirection | Flag : : BitangentFromTangentDirection | Flag : : BitangentDirection | Flag : : NormalDirection ) ) {
_normalMatrixUniform = uniformLocation ( " normalMatrix " ) ;
_normalMatrixUniform = uniformLocation ( " normalMatrix " _s ) ;
_lineWidthUniform = uniformLocation ( " lineWidth " ) ;
_lineWidthUniform = uniformLocation ( " lineWidth " _s ) ;
_lineLengthUniform = uniformLocation ( " lineLength " ) ;
_lineLengthUniform = uniformLocation ( " lineLength " _s ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( _jointCount ) {
if ( _jointCount ) {
_jointMatricesUniform = uniformLocation ( " jointMatrices " ) ;
_jointMatricesUniform = uniformLocation ( " jointMatrices " _s ) ;
_perInstanceJointCountUniform = uniformLocation ( " perInstanceJointCount " ) ;
_perInstanceJointCountUniform = uniformLocation ( " perInstanceJointCount " _s ) ;
}
}
# endif
# endif
}
}
@ -1222,20 +1222,20 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D
# endif
# endif
{
{
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
if ( flags ( ) & ( Flag : : ObjectId | Flag : : VertexId | Flag : : PrimitiveIdFromVertexId ) ) {
setUniform ( uniformLocation ( " colorMapTexture " ) , ColorMapTextureUnit ) ;
setUniform ( uniformLocation ( " colorMapTexture " _s ) , ColorMapTextureUnit ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
if ( flags ( ) > = Flag : : ObjectIdTexture )
if ( flags ( ) > = Flag : : ObjectIdTexture )
setUniform ( uniformLocation ( " objectIdTextureData " ) , ObjectIdTextureUnit ) ;
setUniform ( uniformLocation ( " objectIdTextureData " _s ) , ObjectIdTextureUnit ) ;
if ( flags ( ) > = Flag : : UniformBuffers ) {
if ( flags ( ) > = Flag : : UniformBuffers ) {
setUniformBlockBinding ( uniformBlockIndex ( " Projection " ) , ProjectionBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Projection " _s ) , ProjectionBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Transformation " ) , TransformationBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Transformation " _s ) , TransformationBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Draw " ) , DrawBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Draw " _s ) , DrawBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Material " ) , MaterialBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Material " _s ) , MaterialBufferBinding ) ;
if ( flags ( ) & Flag : : TextureTransformation )
if ( flags ( ) & Flag : : TextureTransformation )
setUniformBlockBinding ( uniformBlockIndex ( " TextureTransformation " ) , TextureTransformationBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " TextureTransformation " _s ) , TextureTransformationBufferBinding ) ;
if ( _jointCount )
if ( _jointCount )
setUniformBlockBinding ( uniformBlockIndex ( " Joint " ) , JointBufferBinding ) ;
setUniformBlockBinding ( uniformBlockIndex ( " Joint " _s ) , JointBufferBinding ) ;
}
}
# endif
# endif
}
}