#include <BVH_Box.lxx>
+//! 2D box of double precision reals.
+typedef BVH_Box<Standard_Real, 2> BVH_Box2d;
+//! 3D box of double precision reals.
+typedef BVH_Box<Standard_Real, 3> BVH_Box3d;
+//! 4D box of double precision reals.
+typedef BVH_Box<Standard_Real, 4> BVH_Box4d;
+
+//! 2D box of single precision reals.
+typedef BVH_Box<Standard_ShortReal, 2> BVH_Box2f;
+//! 3D box of single precision reals.
+typedef BVH_Box<Standard_ShortReal, 3> BVH_Box3f;
+//! 4D box of single precision reals.
+typedef BVH_Box<Standard_ShortReal, 4> BVH_Box4f;
+
#endif // _BVH_Box_Header
{
if (theCtx->core11 == NULL)
{
- theTextFormat = GL_R8; // GL_R32F
+ theTextFormat = GL_R32F;
thePixelFormat = GL_RED;
}
else
{
if (theCtx->core11 == NULL)
{
- theTextFormat = GL_R8; // GL_R32F
+ theTextFormat = GL_R32F;
thePixelFormat = GL_RED;
}
else
}
case Image_PixMap::ImgRGBAF:
{
- theTextFormat = GL_RGBA8; // GL_RGBA32F
+ theTextFormat = GL_RGBA32F;
thePixelFormat = GL_RGBA;
theDataType = GL_FLOAT;
return true;
{
return false;
}
- theTextFormat = GL_RGBA8; // GL_RGBA32F
+ theTextFormat = GL_RGBA32F;
thePixelFormat = GL_BGRA_EXT; // equals to GL_BGRA
theDataType = GL_FLOAT;
return true;
}
case Image_PixMap::ImgRGBF:
{
- theTextFormat = GL_RGB8; // GL_RGB32F
+ theTextFormat = GL_RGB32F;
thePixelFormat = GL_RGB;
theDataType = GL_FLOAT;
return true;
case Image_PixMap::ImgBGRF:
{
#if !defined(GL_ES_VERSION_2_0)
- theTextFormat = GL_RGB8; // GL_RGB32F
+ theTextFormat = GL_RGB32F;
thePixelFormat = GL_BGR; // equals to GL_BGR_EXT
theDataType = GL_FLOAT;
return true;
myHasMipmaps = Standard_False;
myTextFormat = thePixelFormat;
#if !defined(GL_ES_VERSION_2_0)
+ if (theTextFormat >= Image_PixMap::ImgGrayF
+ && !theCtx->HasFloatingPointTexture())
+ {
+ TCollection_ExtendedString aMsg ("Error: floating-point textures are not supproted by hardware.");
+ theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION,
+ GL_DEBUG_TYPE_ERROR,
+ 0,
+ GL_DEBUG_SEVERITY_HIGH,
+ aMsg);
+
+ Release (theCtx.operator->());
+ return false;
+ }
const GLint anIntFormat = theTextFormat;
#else
// ES does not support sized formats and format conversions - them detected from data type
glTexImage1D (GL_PROXY_TEXTURE_1D, 0, anIntFormat,
aWidth, 0,
thePixelFormat, theDataType, NULL);
- glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &aTestWidth);
+ glGetTexLevelParameteriv (GL_PROXY_TEXTURE_1D, 0, GL_TEXTURE_WIDTH, &aTestWidth);
if (aTestWidth == 0)
{
// no memory or broken input parameters
const GLint anIntFormat = theFormat.Internal();
myTextFormat = theFormat.Format();
+ if (anIntFormat == GL_FLOAT
+ || !theCtx->HasFloatingPointTexture())
+ {
+ TCollection_ExtendedString aMsg ("Error: floating-point textures are not supproted by hardware.");
+
+ theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION_ARB,
+ GL_DEBUG_TYPE_ERROR_ARB,
+ 0,
+ GL_DEBUG_SEVERITY_HIGH_ARB,
+ aMsg);
+
+ Release (theCtx.operator->());
+ Unbind (theCtx);
+ return false;
+ }
+
glTexImage2D (GL_PROXY_TEXTURE_RECTANGLE,
0,
anIntFormat,
#define THE_SHADER_IN in
#define THE_SHADER_OUT out
#define THE_OUT out
+ #define occTexture1D texture
#define occTexture2D texture
+ #define occTexture3D texture
#else
#define THE_ATTRIBUTE attribute
#define THE_SHADER_IN varying
#define THE_SHADER_OUT varying
#define THE_OUT
+ #define occTexture1D texture1D
#define occTexture2D texture2D
+ #define occTexture3D texture3D
#endif
#ifdef GL_ES
THE_ATTRIBUTE vec4 occTexCoord;
THE_ATTRIBUTE vec4 occVertColor;
#elif (__VERSION__ >= 130)
- out vec4 occFragColor;
+ out vec4 occFragColor;
+ out float occFragDepth;
#else
#define occFragColor gl_FragColor
+ #define occFragDepth gl_FragDepth
#endif
// Matrix state