1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

109 Commits

Author SHA1 Message Date
dbp
e99a2f7cae 0026081: Visualization, TKOpenGl - rebuild vertex attributes in order to not render large index arrays in OpenGL ES 2015-04-30 13:21:52 +03:00
kgv
38a0206f60 0026025: Visualization, TKOpenGl - stereoscopic output does not work
OpenGl_View::Render() - pass target FBO as parameter.
OpenGl_Context - revise Read/Write buffers management logic, taking into account FBOs.

Graphic3d_Camera::UpdateProjection() - setup LProjection and RProjection
the same as MProjection in case of Projection_MonoLeftEye/Projection_MonoRightEye
for API consistency.
2015-04-24 13:16:27 +03:00
isz
c87535af15 0025372: Visualization, TKOpenGl - suppress annoying verbose messages from NVIDIA OpenGL driver
OpenGl_GlCore42 - drop functions unrelated to OpenGL 4.2 core functionality
2015-04-23 17:52:13 +03:00
kgv
447c411576 0026012: Visualization, TKOpenGl - fix misprints in detection of high precision floats within OpenGL ES 2.0 2015-04-09 14:14:45 +03:00
kgv
a2e4f780c2 0025973: Visualization, TKOpenGl - support EAGLContext as alternative to NSOpenGLContext
OpenGl_FrameBuffer::InitWithRB() - add method to initialize FBO with Render Buffer Objects.
OpenGl_FrameBuffer::InitWrapper() - add new method to initialize FBO from currently bound in context.

Aspect_RenderingContext - define type explicitly to EAGLContext* / NSOpenGLContext* for ARC.
OpenGl_Window - allow initialization from alien context for OS X / iOS.
2015-04-06 17:26:01 +03:00
kgv
d4271fe56f 0026002: Visualization, TKOpenGl - detect alien Core Profile context
Read GL_CONTEXT_PROFILE_MASK flags.

Update of unstable test-case
2015-04-06 17:25:12 +03:00
aba
e1c659da58 0023484: Visualization, TKOpenGl - primitive arrays to become the only way to render geometry
OpenGl_CappingAlgo - draw capping plane using OpenGl_PrimitiveArray.
OpenGl_Trihedron - draw trihedron in wireframe mode using OpenGl_PrimitiveArray.

~OpenGl_Context() - release Delayed resources occured after deletion of Shared resources.

Draw Harness, vzbufftrihedron command - redraw viewer after trihedron definition.
2015-04-06 17:24:23 +03:00
kgv
ee51a9fe3a 0025897: Visualization, TKOpenGl - disable FBO blitting after first failure on broken OpenGL context
OpenGl_Context::init() - detect OpenGL 2.0+ broken context by wrong GLSL version string.
Emit error messages when OpenGL context reports version higher than actually exported.

Improve logic of methods drawing Immediate presentations and swapping the Buffers.
OpenGl_Workspace::myTransientDrawToFront - repair functionality of this flag
to always render Immediate Objects into Back Buffer.
OpenGl_Workspace::myHasFboBlit - add new flag to disable FBO blitting after first failure.
2015-03-12 12:23:56 +03:00
bugmaster
458c2c5828 Eliminating problem of TKOpenGl compilation 2015-03-05 17:11:08 +03:00
kgv
4e1523ef0b 0025854: Visualization, TKOpenGl - add option to request Core profile 3.2+
OpenGl_Caps::contextCompatible - new option to request compatibility/core OpenGL profile.
OpenGl_Window - request core profile when requested (WGL and Cocoa).
OpenGl_Context::CheckExtension() - retrieve extensions using glGetStringi().
OpenGl_Context::init() - set backward-compatible functions to NULL within core profile:
core11, core15, core20, core32back, core33back, core41back, core42back, core43back, core44back.
OpenGl_Context::BindDefaultVao() - create default VAO required for core profile.
OpenGl_Context::ReadGlVersion() - make method public.
OpenGl_ShaderManager - create programs using GLSL version 150 when available.
OpenGl_VertexBuffer, OpenGl_ShaderProgram, OpenGl_ShaderObject - use
functions set from core profile instead of compatibility.

TKOpenGl - escape deprecated functionality with runtime checks.

Command vcaps - add option -compatibleProfile to request core/compatibility profile.
NIS_View - prevenr rendering within Core profile (unsupported).

Test case for issue CR25854

Aspect_GraphicCallbackStruct::IsCoreProfile - add new field to the struct for NIS
2015-03-05 16:02:32 +03:00
kgv
b86bb3df20 0025091: Visualization - use FBO for layer with immediate objects 2015-02-19 16:13:15 +03:00
duv
c827ea3a68 0024381: Visualization, TKOpenGl - revise matrices stack and usage of temporary matrices
0025301: Visualization, TKOpenGl - transpose matrix manually before glUniformMatrix4fv()

OpenGl_View::ReleaseGlResources() - release GL resources of trihedron, do not destroy it
2014-11-05 17:54:48 +03:00
kgv
00ea319b16 0025442: Visualization, TKOpenGl - prevent inclusion of system header glxext.h
Define GLX_GLXEXT_LEGACY in addition to GL_GLEXT_LEGACY to prevent implicit
inclusion of header GL/glxext.h by system header GL/glx.h

Update glext.t to current state.
2014-11-05 17:48:03 +03:00
abv
0797d9d30a 0025418: Debug output to be limited to OCC development environment
Macros ending on "DEB" are replaced by OCCT_DEBUG across OCCT code; new macros described in documentation.
Macros starting with DEB are changed to start with "OCCT_DEBUG_".
Some code cleaned.
2014-11-05 16:55:24 +03:00
kgv
05e2200bbf 0025422: Visualization, TKOpenGl - support re-assignment of new window to existing View
Do not throw "Window already defined" exception in Visual3d_View/V3d_View.
Handle window change within OpenGl_GraphicDriver::View().

OpenGl_GraphicDriver - introduce dedicated methods to initialize/release shared OpenGL context.
::InitEglContext() to using existing EGL context.

OpenGl_Context - always enable NPOT textures on OpenGL ES 2.0

OpenGl_Workspace - do not call glDisable/glEnable(GL_TEXTURE_2D) on GL ES

OpenGl_GraphicDriver::ReleaseContext() - release EGL context on destruction

OpenGl_GraphicDriver::InitEglContext() - escape method implementation with HAVE_EGL macros

OpenGl_ShaderManager - clear shader programs on shared context invalidation
2014-10-30 13:52:02 +03:00
kgv
afbdee68fa 0025417: Visualization, OpenGl_Context - fix preprocessor check to load GL functions on OS X 2014-10-24 11:18:52 +04:00
dbp
25ef750e44 025306: Visualization, TKOpenGl - support texturing within RayTracing
Fix bug with overlay OpenGL text.
2014-10-23 16:20:36 +04:00
dbv
63c629aa3a 0025266: Debug statements in the source are getting flushed on to the console
Output to cout activated previously in Debug mode by #ifdef DEB is suppressed by using macro <PACKAGE>_DEB instead of DEB
2014-10-16 16:44:56 +04:00
duv
7d9e854bdc 0025276: Visualization - Lighting is broken if some kinds of transformation applied to a shape
In order to solve the problem, triangle vertices order is inverted in
mirrored mesh (triangulation). Mesh considered to be mirrored if its
transformation matrix determinant is less than 0.

To handle AIS object mirror transformations "Mirrored" flag stored in
OpenGl_Structure. If this flag is enabled, glFrontFace (GL_CW) applied
before the draw call.

New DRAW commands for visualization level transformations added.
2014-10-16 14:58:33 +04:00
kgv
8625ef7e94 0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as alternative to FFP
Enumerations Visual3d_TypeOfModel, V3d_TypeOfShadingModel.
- Remove unused values V3d_MULTICOLOR, V3d_HIDDEN, Visual3d_TOM_INTERP_COLOR.
- Add per-pixel shading mode - V3d_PHONG, Visual3d_TOM_FRAGMENT.

Draw Harness command vrenderparams.
Add option -shadingModel to setup Shading Model.

OpenGl_Caps::ffpEnable - new option to switch FFP/built-in GLSL programs.
OpenGl_ShaderManager - add built-in GLSL programs.

Draw Harness command vcaps.
- Fix command syntax to meet coding rules.
- Add option -ffp to activate/disable built-in GLSL programs.

GLSL API changes.
- Rename vertex attribute occColor -> occVertColor.
- Introduce vec4 occColor uniform variable for light-less shaders.
- Introduce float occPointSize uniform variable for marker programs.

OpenGl_VertexBuffer::bindAttribute() - activate normalization for non-GL_FLOAT types,
since color attribute is defined as 32-bit vector of 4 unsigned byte values.

OpenGl_Context - add methods SetColor4fv() and SetPointSize()
for parameters redirection to active GLSL program
(as alternative to glColor4fv() and glPointSize()).

OpenGl_ShaderProgram - define default precision for float types
in Fragment Shader within OpenGL ES 2.0+ context.

OpenGl_AspectMarker, initialize Aspect_TOM_O_POINT display list
in the same way as sprite texture.

OpenGl_Texture, do not use sized internal formats on OpenGL ES.
2014-10-02 14:29:19 +04:00
kgv
ca3c13d1e8 0025219: Visualization, TKOpenGl - disable code paths unavailable on OpenGL ES 2.0 2014-09-25 15:58:33 +04:00
kgv
7d3e64ef5e 0025213: Visualization, TKOpenGl - do not use deprecated built-ins in GLSL shaders
Inherit NCollection_Buffer from Standard_Transient, do not use incomplete NCollection_Handle.

OpenGl_Context, add methods ActiveProgram(),BindProgram()
to manage currently active GLSL program.
Add method ::ToUseVbo().

OpenGl_ShaderProgram, setup locations of pre-defined vertex attributes
occVertex, occNormal, occTexCoord, occColor before linkage.
Remove methods OpenGl_ShaderProgram::Bind(), ::BindWithVariables()
and ::Unbind() - OpenGl_Context::BindProgram() should be used instead.

Introduce class OpenGl_VertexBufferCompat, which emulates VBO
behavior on systems without VBO (compatibility with broken OpenGL drivers on Windows).

OpenGl_PrimitiveArray - use OpenGl_VertexBufferCompat when VBO is unavailable,
remove duplicated code. Use OpenGl_VertexBuffer::HasNormalAttribute()
method to activate lighting.

OpenGl_Text - use OpenGl_VertexBufferCompat, eliminate duplicated code.

Changes in OpenGl_VertexBuffer, drop methods BindFixed()/UnbindFixed().
Superseded by new methods BindAllAttributes()/UnbindAllAttributes()
which handle active GLSL program, when it is set.
2014-09-18 15:24:07 +04:00
kgv
da8bb41da6 0025158: Visualization, OpenGl_Context - support EGL as alternative to WGL and GLX 2014-08-21 15:51:01 +04:00
dln
3125ebb6f3 0024742: Remove rarely used collection classes: Queue
Generic "TCollection_Queue" class removed (along with "TCollection_QueueNode" and three instantiations in TColStd). Template class TCollection_Queue removed.

The code using queue classes converted to use lists for the same purpose (replacing Push -> Append, Front -> First, Pop -> RemoveFirst). In OpenGl_Context, list is used as stack instead of queue, for it looks more natural for release of resources (last allocated - first released).
2014-05-07 16:07:49 +04:00
ski
53ca691b7b 0024853: CLang warnings -Wunused-const-variable
Unused variables were removed.
2014-04-24 15:43:28 +04:00
kgv
01ca42b2c1 0024732: OpenGl_Context - retrieve functions up to GL4.4
Drop unused OpenGl_ArbVBO.
Replace OpenGl_ExtFBO with OpenGl_ArbFBO.

OpenGl_Context - reorganize GL functions management.
OpenGl_GlFunctions structure now stores pointers for all GL functions,
while inheritors specify functions subset using access levels.
Drop fields core12, core13, core14; replace extFBO by arbFBO.

OpenGl_ArbIns, OpenGl_ArbTBO - use GL3.1 core functions
instead of ARB extensions when available.

OpenGl_ArbFBO - provide complete list of functions

OpenGl_GlCore11 - fix misprint

OpenGl_Context.hxx - remove redundant declarations
2014-03-20 13:51:05 +04:00
osa
f8c8ba7a6d 0024671: TKOpenGl, OpenGl_Context - glGetPointerv might be called without GL context 2014-03-06 13:12:58 +04:00
abv
d5f74e42d6 0024624: Lost word in license statement in source files
License statement text corrected; compiler warnings caused by Bison 2.41 disabled for MSVC; a few other compiler warnings on 54-bit Windows eliminated by appropriate type cast
Wrong license statements corrected in several files.
Copyright and license statements added in XSD and GLSL files.
Copyright year updated in some files.
Obsolete documentation files removed from DrawResources.
2014-02-20 16:15:17 +04:00
dbp
265d4508bd 0024503: TKOpenGl - Porting ray-tracing component on BVH package
Updated test case v3d/raytrace/bug24130. The new version checks correctness of shadows.
2014-01-30 12:55:06 +04:00
duv
b5ac8292b0 0024001: Stereographic rendering support
Deleted TODOs which were used when branch was built without OpenCL.
Modified test case bugs/vis/bug23747_2 (changed textured shape)
2014-01-23 14:46:06 +04:00
kgv
7e7c2f0b6f 0024497: TKOpenGl, OpenGl_Context - Add getter for window field 2014-01-09 12:27:29 +04:00
bugmaster
6aca4d3977 0024516: Copyright information has been corrupted within some headers
Update incorrectly modified header files
2014-01-09 12:05:23 +04:00
bugmster
973c2be1e1 0024428: Implementation of LGPL license
The copying permission statements at the beginning of source files updated to refer to LGPL.
Copyright dates extended till 2014 in advance.
2013-12-17 12:42:41 +04:00
kgv
9293178ba0 0024312: Compilation issues on OS X 10.9 Maverics SDK
Update glext.h. Fix compiler errors.
2013-11-05 09:19:42 +04:00
kgv
392ac9808e 0024250: TKOpenGl - per-pixel lighting using GLSL program (Phong shading) 2013-11-01 14:05:56 +04:00
apl
30f0ad2866 0024192: Adding support for shaders to OCCT visualization toolkit 2013-10-24 16:03:22 +04:00
apl
fd4a696350 0024228: TKOpenGL - destroy GL context at view close
- OpenGl_Display - release GL resources correctly on closing views
- OpenGl_AspectFace, OpenGl_AspectText, OpenGl_AspectLine, OpenGl_AspectMarker - initialize OpenGl resources on demand, when context is available.
- Graphic3d_TextureRoot - use const modifier for GetId method to avoid asynchronous resource state at OpenGl.
- Do not call OpenGL functions if no active GL context has been left
- Reset thread's context before deletion for Mesa WNT
2013-10-24 16:03:20 +04:00
ski
2f6cb3ac69 0024274: Eliminate GCC compiler warning (wrong initialize order)
Eliminated GCC compiler warning about wrong initialize order
2013-10-24 11:56:50 +04:00
apl
b859a34d22 0024224: Suspicious logics in changing clipping planes at OpenGl_Structure
1) Resolved buggy situation of shared clip planes between view and structure;
2) Added clipping plane equation space identification - to be used with shaders;
3) Code refactoring to resolve performance issue reported by 0024189;
4) Attachment of stencil buffer to FBO.

Added test case bugs/vis/bug24224
2013-10-10 17:15:53 +04:00
kgv
cbf1862449 0024245: TKOpenGL - use Message_Messenger interface to report issues 2013-10-10 17:09:06 +04:00
kgv
fcdbe2010e 0024230: TKOpenGl - request debug context by default in debug mode
Enable GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB only for debug builds.
2013-10-10 14:33:05 +04:00
apl
4269bd1b11 0024070: OpenGL capped object-level clipping planes
Graphical clipping:
- Use "Graphic3d_ClipPlane" to defined clipping for PrsMgr_PresentableObject (local clipping), for V3d_View (global clipping).

Get rid of old implementations:
- Remove Visual3d_ClipPlane.
- Port V3d_Plane to Graphic3d_ClipPlane core.

Selection Sensitives:
- Port "Matches" method to add full set of arguments (SelectBasics_PickArgs), including min-max depth coming from selector.
- Get rid of transient data for pair Matches -> ComputeDepth.
- Extend SelectMgr_ViewerSelector::LoadResult to work with local clipping, add virtual callbacks to compute globa/local depth clipping for picking.

Capping rendering algorithm:
- Recursive rendering algorithm for OpenGl_Groups.
- Introduced Rendering filter for groups.

Clipping plane management in TKOpenGl:
- Added OpenGl_ClippingState to OpenGl_Context.

DRAWEXE commands:
- Ported "vclipplane" command for new approach.
- Added "vsettexturemode" command for changing texture details in views (enable / disable textures).

Correct DownCast syntax (compilation error)

Fix new compiler warnings

tests/bugs/vis/bug22906 migrated to the new vclipplane syntax
2013-09-20 12:09:54 +04:00
omy
eafb234bf1 0024171: Eliminate CLang compiler warning -Wreorder
Got rid of -Wreorder warning (wrong fields' initialization order); some warnings -Wdangling-else are also fixed
2013-09-18 09:36:12 +04:00
kgv
58655684c0 0024123: Create debug OpenGL context when requested (GL_ARB_debug_output)
Introduce new OpenGl_Caps class for unified graphic driver options access.
New command vgldebug to request debug OpenGL context.
OpenGl_Window  - create debug OpenGL context when requested (WGL-only).
OpenGl_Context - destroy arbTBO, arbIns members.
Workaround namespace collisions with Xlib macros
Eliminate new warning (unused argument in OpenGl_Context::debugCallbackWrap)
2013-08-29 15:46:40 +04:00
kgv
6a7d83c480 0023904: Multiple warning on Windows x86_64 target concerning WinAPI usage 2013-05-23 11:57:26 +04:00
kgv
a174a3c54f 0023457: Slow text rendering
Added class Font_FTFont wrapper over FreeType face

Unify collections methods NCollection_Array1, NCollection_Sequence, NCollection_Vector:
declare Upper, Lower, First, Last, ChangeFirst, ChangeLast methods for all these collections.

Added method NCollection_DataMap::Find() with check key is bound + retrieve value within single call interface.

OpenGl_Context::ReleaseResource() method now supports lazy release of shared resources.

Added class OpenGl_Font which implements textured fonts support.
Added class OpenGl_TextFormatter for text formatting using OpenGl_Font.

OpenGl_Text was redesigned to use OpenGl_FontFormatter.

OpenGl_FontMgr class was removed.
All methods related to text rendered removed from OpenGl_Display class.

OpenGl_Trihedron and OpenGl_GraduatedTrihedron classes were redesigned
to use OpenGl_Text.

OpenGl_PrinterContext instance was moved to OpenGl_GraphicDriver fields
(eliminated usage of global instance).

Added test cases into 3rdparty/fonts grid to check different font styles
and perform FPS tests (no automated results - requires manual analysis
or snapshots comparisons).

Removed unused CSF_FTGL dependency.
OpenGl_Text::setupMatrix - do not apply floor for myWinZ
2013-02-08 15:05:16 +04:00
kgv
1a7dfdb719 0023632: Add support for NPOT mipmap textures in TKOpenGl
Use glGenerateMipmap instead of gluBuild2DMipmaps when available.
2012-12-28 18:24:40 +04:00
bugmaster
4fe5661921 0023243: Adapt OpenGL viewer for using in Cocoa applications on Mac OS X
Cocoa_Window draft
OpenGl_Context and OpenGl_Window - added support for Cocoa OpenGL context
TKV3d - accept Cocoa_Window
Draft version of ViewerInit method for Mac OS X
Added ViewerTest_CocoaEventManagerView
ViewerTest - attach events to Cocoa window
Cocoa_Window - disable autorelease on close
Fix for OpenGl_Context::Init method
Cocoa_Window - convert top-left coordinates to bottom-left
Added selection with rubber band (rubber band drawing still should be implemented)
Fixed OpenGl_Display initialization on Mac OS X
Fixed OpenGl includes
2012-12-24 17:46:07 +04:00
kgv
bf75be9867 0023544: Texture management in TKOpenGl should be redesigned
Structures Graphic3d_CView, Graphic3d_CStructure, Graphic3d_CGroup become classes and their definitions moved from InterfaceGraphic to Graphic3d.
Introduced new class OpenGl_Texture as replacement for OpenGl_ResourceTexture class and static functions in OpenGl_TextureBox.
Graphic3d_TextureRoot now no more communicate within Graphic3d_GraphicalDriver.
Instead class returns image through GetImage() method.
OpenGl_AspectFace - avoid possible NULL-dereference
OpenGl_Texture::Init() - check gluBuild2DMipmaps() return value
OpenGl_Texture - check GL_BGRA_EXT for compatibility
OpenGl_Texture - scale NPOT image when required
Added more description to Graphic3d_TextureRoot class
OpenGl_Texture - added missing break statement for ImgBGR32 case
OpenGl_Workspace::setTextureParams() - fixed local variable aFilterMin overrides visibility of early declared variable
OpenGl_Workspace::DisableTexture() - reset texture matrix
FTGL do not reset texture matrix and corrupt text could be rendered if custom texture has not identity texture matrix.
2012-12-07 13:58:30 +04:00
aba
86325709af 0023418: Crash on the object displaying when running DRAW on remote station. OpenGL version determination was corrected
Small style changes
Comments were corrected
2012-11-30 15:40:17 +04:00