swapInterval (1),
useZeroToOneDepth (Standard_False),
buffersNoSwap (Standard_False),
- buffersOpaqueAlpha(Standard_False),
+ buffersOpaqueAlpha(Standard_True),
contextStereo (Standard_False),
contextDebug (Standard_False),
contextSyncDebug (Standard_False),
glslDumpLevel (OpenGl_ShaderProgramDumpLevel_Off)
{
#if defined(__EMSCRIPTEN__)
- buffersNoSwap = true; // swap has no effect in WebGL
- buffersOpaqueAlpha = true; // avoid unexpected blending of canvas with page background
+ buffersNoSwap = true; // swap has no effect in WebGL
#endif
#ifdef OCCT_DEBUG
contextDebug = true;
{
myRaytraceFBO1[aFBOIdx]->BindBuffer (theGlContext);
- glClear (GL_DEPTH_BUFFER_BIT); // render the image with depth
+ theGlContext->core11fwd->glClear (GL_DEPTH_BUFFER_BIT); // render the image with depth
}
theGlContext->core20fwd->glDrawArrays (GL_TRIANGLES, 0, 6);
if (myRenderParams.IsAntialiasingEnabled)
{
- glDisable (GL_DEPTH_TEST); // improve jagged edges without depth buffer
+ theGlContext->core11fwd->glDisable (GL_DEPTH_TEST); // improve jagged edges without depth buffer
// bind ray-tracing output image as input
myRaytraceFBO1[aFBOIdx]->ColorTexture()->Bind (theGlContext, OpenGl_RT_FsaaInputTexture);
const Handle(OpenGl_FrameBuffer)& aRenderImageFramebuffer = myRaytraceFBO2[aFBOIdx];
const Handle(OpenGl_FrameBuffer)& aDepthSourceFramebuffer = myRaytraceFBO1[aFBOIdx];
- glEnable (GL_DEPTH_TEST);
+ theGlContext->core11fwd->glEnable (GL_DEPTH_TEST);
// Display filtered image
theGlContext->BindProgram (myOutImageProgram);
// extend viewport here, so that tiles at boundaries (cut tile size by target rendering viewport)
// redirected to inner tiles (full tile size) are drawn entirely
const Graphic3d_Vec2i anOffsetViewport = myTileSampler.OffsetTilesViewport (myAccumFrames > 1); // shrunk offsets texture will be uploaded since 3rd frame
- glViewport (0, 0, anOffsetViewport.x(), anOffsetViewport.y());
+ theGlContext->core11fwd->glViewport (0, 0, anOffsetViewport.x(), anOffsetViewport.y());
}
+ const NCollection_Vec4<bool> aColorMask = theGlContext->ColorMaskRGBA();
+ theGlContext->SetColorMaskRGBA (NCollection_Vec4<bool> (true)); // force writes into all components, including alpha
// Generate for the given RNG seed
- glDisable (GL_DEPTH_TEST);
+ theGlContext->core11fwd->glDisable (GL_DEPTH_TEST);
// Adaptive Screen Sampling computes the same overall amount of samples per frame redraw as normal Path Tracing,
// but distributes them unequally across pixels (grouped in tiles), so that some pixels do not receive new samples at all.
}
aRenderImageFramebuffer->UnbindBuffer (theGlContext);
+ theGlContext->SetColorMaskRGBA (aColorMask);
if (myRaytraceParameters.AdaptiveScreenSampling
&& myRaytraceParameters.AdaptiveScreenSamplingAtomic)
{
- glViewport (0, 0, theSizeX, theSizeY);
+ theGlContext->core11fwd->glViewport (0, 0, theSizeX, theSizeY);
}
return true;
}
aRenderImageFramebuffer->ColorTexture()->Bind (theGlContext, OpenGl_RT_PrevAccumTexture);
// Copy accumulated image with correct depth values
- glEnable (GL_DEPTH_TEST);
+ theGlContext->core11fwd->glEnable (GL_DEPTH_TEST);
theGlContext->core20fwd->glDrawArrays (GL_TRIANGLES, 0, 6);
aRenderImageFramebuffer->ColorTexture()->Unbind (theGlContext, OpenGl_RT_PrevAccumTexture);
0, GL_DEBUG_SEVERITY_MEDIUM, "Error: Failed to acquire OpenGL image textures");
}
- glDisable (GL_BLEND);
+ theGlContext->core11fwd->glDisable (GL_BLEND);
const Standard_Boolean aResult = runRaytraceShaders (theSizeX,
theSizeY,
puts "OCC26726 erase selected objects"
puts "============"
puts ""
-pload VISUALIZATION
+pload VISUALIZATION
vclear
-vclose all
vinit View1
-vsetdispmode 1
box b0 5 0 0 1 1 1
box b1 0 5 0 1 1 1
box b2 0 0 5 1 1 1
box b3 5 5 5 1 1 1
-vdisplay b0 b1 b2 b3
-
-vdump $imagedir/${casename}_0.png
-
+vdisplay b0 b1 b2 b3 -dispMode 1
vfit
+vdump $imagedir/${casename}_0.png
vselect 0 0 500 500
verase
-
vdump $imagedir/${casename}_1.png
-set info_b0 [vreadpixel 205 355 name]
-set info_b1 [vreadpixel 205 190 name]
-set info_b2 [vreadpixel 60 100 name]
-set info_b3 [vreadpixel 350 100 name]
-
-if { $info_b0 != "BLACK 0" || $info_b1 != "BLACK 0" || $info_b2 != "BLACK 0" || $info_b3 != "BLACK 0" } {
+set info_b0 [vreadpixel 205 355 -rgb -name]
+set info_b1 [vreadpixel 205 190 -rgb -name]
+set info_b2 [vreadpixel 60 100 -rgb -name]
+set info_b3 [vreadpixel 350 100 -rgb -name]
+if { $info_b0 != "BLACK" || $info_b1 != "BLACK" || $info_b2 != "BLACK" || $info_b3 != "BLACK" } {
puts "Error: OCC26726 is reproduced. AIS_InteractiveContext::EraseSelected is incorrect."
}