mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0024739: TKOpenGl - port ray-tracing from OpenCL to GLSL for better integration and portability
RayTracing - disable reflections by default Fix possible compilation issue on Mac OS X.
This commit is contained in:
@@ -127,6 +127,45 @@ bool OpenGl_TextureBufferArb::Init (const Handle(OpenGl_Context)& theGlCtx,
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool OpenGl_TextureBufferArb::Init (const Handle(OpenGl_Context)& theGlCtx,
|
||||
const GLuint theComponentsNb,
|
||||
const GLsizei theElemsNb,
|
||||
const GLuint* theData)
|
||||
{
|
||||
if (theComponentsNb != 1
|
||||
&& theComponentsNb != 2
|
||||
&& theComponentsNb != 3
|
||||
&& theComponentsNb != 4)
|
||||
{
|
||||
// unsupported format
|
||||
return false;
|
||||
}
|
||||
else if (!Create (theGlCtx)
|
||||
|| !OpenGl_VertexBuffer::Init (theGlCtx, theComponentsNb, theElemsNb, theData))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (theComponentsNb)
|
||||
{
|
||||
case 1: myTexFormat = GL_R32I; break;
|
||||
case 2: myTexFormat = GL_RG32I; break;
|
||||
case 3: myTexFormat = GL_RGB32I; break;
|
||||
case 4: myTexFormat = GL_RGBA32I; break;
|
||||
}
|
||||
|
||||
Bind (theGlCtx);
|
||||
BindTexture (theGlCtx);
|
||||
theGlCtx->arbTBO->glTexBuffer (GetTarget(), myTexFormat, myBufferId);
|
||||
UnbindTexture (theGlCtx);
|
||||
Unbind (theGlCtx);
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : BindTexture
|
||||
// purpose :
|
||||
|
Reference in New Issue
Block a user