1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
Commit graph

522 commits

Author SHA1 Message Date
AnyOldName3
7255c266ba Merge branch 'osgshadow-test-vdsm' into osgshadow-test-dicking-around-with-cascading-shadow-maps 2018-05-16 21:21:05 +01:00
AnyOldName3
fc1aee10f4 Remove function declaration that somehow snuck in. 2018-05-16 21:20:17 +01:00
AnyOldName3
1b30d47d7f Add a hacky temporary version of cascading shadow maps 2018-05-13 12:56:40 +01:00
AnyOldName3
44b2cf2b7f Merge upstream. 2018-05-11 19:15:04 +01:00
AnyOldName3
166e7df778 Improve debug HUD frustum 2018-05-11 19:08:42 +01:00
AnyOldName3
4547151863 Add the view frustum to the debug HUD (in the most annoying way possible) 2018-05-05 00:08:00 +01:00
scrawl
6c79c0fb35
Add an empty compileGLObjects implementation to Rig/MorphGeometry to avoid unnecessary creation of display list done by osg 2018-04-18 12:36:08 +00:00
elsid
14daadded7
Add virtual destructors
To fix warnings:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:588:8: warning: delete called on non-final 'NifOsg::ControllerFunction' that has virtual functions but non-virtual destructor
      [-Wdelete-non-virtual-dtor]
              delete __p;
              ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization
      'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here
        : __shared_count(__p)
          ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization
      'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here
        : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type())
                       ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr.h:129:25: note: in instantiation of function template specialization 'std::__shared_ptr<NifOsg::ControllerFunction,
      __gnu_cxx::_S_atomic>::__shared_ptr<NifOsg::ControllerFunction, void>' requested here
        shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
                               ^
/home/elsid/dev/openmw/components/nifosg/nifloader.cpp:242:39: note: in instantiation of function template specialization 'std::shared_ptr<NifOsg::ControllerFunction>::shared_ptr<NifOsg::ControllerFunction, void>' requested here
                callback->setFunction(std::shared_ptr<NifOsg::ControllerFunction>(new NifOsg::ControllerFunction(key)));
                                      ^

/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:78:2: warning: delete called on non-final 'MWGui::ResponseCallback' that has virtual functions but non-virtual destructor
      [-Wdelete-non-virtual-dtor]
        delete __ptr;
        ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:268:4: note: in instantiation of member function 'std::default_delete<MWGui::ResponseCallback>::operator()' requested here
          get_deleter()(__ptr);
          ^
/home/elsid/dev/openmw/apps/openmw/mwgui/dialogue.cpp:58:23: note: in instantiation of member function 'std::unique_ptr<MWGui::ResponseCallback, std::default_delete<MWGui::ResponseCallback> >::~unique_ptr' requested here
    PersuasionDialog::PersuasionDialog(ResponseCallback* callback)
                      ^
2018-04-01 21:51:59 +03:00
AnyOldName3
e885612bd7 Make a dynamic cast static 2018-03-03 02:05:46 +00:00
AnyOldName3
b553b58de5 Fix another compiler warning 2018-03-03 02:03:16 +00:00
AnyOldName3
3bed2a7b01 Fix some copiler warnings (hopefully) 2018-03-03 02:01:03 +00:00
AnyOldName3
fc41902798 Replace a dynamic cast with string comarison 2018-03-01 14:37:11 +00:00
AnyOldName3
bc4b4c66e4 (Hopefully) add include which G++ requires even though VC++ doesn't. 2018-02-27 16:54:48 +00:00
AnyOldName3
d1a2955fa1 Merge upstream 2018-02-27 14:29:14 +00:00
AnyOldName3
66a114d6ec Fix a couple of warnings 2018-02-27 14:15:06 +00:00
AnyOldName3
f9cf1ac94b Separate indoor and outdoor shadow casting masks. 2018-02-27 00:13:51 +00:00
AnyOldName3
35eb71052e Tidy up the shadow manager 2018-02-26 23:52:46 +00:00
AnyOldName3
882b63cba9 Make split point control parameters configurable with the new shadow technique. 2018-02-26 23:00:46 +00:00
AnyOldName3
e233dae1cd Hook up the new shadow technique 2018-02-26 22:27:09 +00:00
AnyOldName3
97b607fc66 Make whitespace match upstream OSG 2018-02-26 21:10:06 +00:00
AnyOldName3
99db93510c Undo minor cockup where the same file appeared twice 2018-02-26 21:09:29 +00:00
AnyOldName3
639a4f5e8c Remove TODO left in by accident. Also, become 100 commits ahead of upstream. 2018-02-26 20:52:19 +00:00
AnyOldName3
478367bef3 Ensure the debug HUD won't crash if settings are changed at runtime. 2018-02-26 20:50:54 +00:00
AnyOldName3
7b52091a82 Make the debug hud enableable 2018-02-26 20:36:43 +00:00
AnyOldName3
5d719e9d5f Add the debug HUD to the new shadow technique 2018-02-26 20:20:01 +00:00
AnyOldName3
76f23c28b1 Make shadows disableable. 2018-02-26 16:25:44 +00:00
AnyOldName3
0f1e770c53 Transfer changes to cull to new shadow technique 2018-02-26 15:51:22 +00:00
AnyOldName3
4c31b38f77 Move CLSB changes to new shadow technique 2018-02-26 14:58:12 +00:00
AnyOldName3
06b2ce6646 Fix alignment issues caused by renaming classes 2018-02-26 14:34:14 +00:00
AnyOldName3
02d0ee3485 Rename old shadow class to shadow manager 2018-02-26 14:29:31 +00:00
AnyOldName3
ce02c83089 Copy debug shader source into new shadow technique 2018-02-26 14:27:47 +00:00
AnyOldName3
7bd4c5e4b3 Change class name 2018-02-24 00:57:58 +00:00
AnyOldName3
c815366044 Move to the correct namespace part 2 2018-02-24 00:55:24 +00:00
AnyOldName3
11e59d3c11 Move to the correct namespace. 2018-02-24 00:52:46 +00:00
AnyOldName3
324b398d29 Add a notice clarifying the source of the shadow technique files. 2018-02-24 00:15:54 +00:00
AnyOldName3
7467248555 Undo a modification from the upstream shadow technique which breaks compatibiltiy with OSG 3.4 2018-02-24 00:14:29 +00:00
AnyOldName3
273914aba8 Add osgShadow ViewDependentShadowMaps as they can be found in OSG's GitHub Repository 2018-02-24 00:13:05 +00:00
AnyOldName3
9ec59783ba Add basic support for distant terrain CLSB
(cherry picked from commit 0f9dc3e65b72e6fff762f7a0933bae6f861e5fd4)
2018-02-23 23:37:04 +00:00
AnyOldName3
cb6767b4fc Move the declaration of ComputeLightSpaceBounds to the header so that it can be accessed from other compilation units.
(cherry picked from commit 8ac4fb208897a18da4934dd6f2fe84560b44ba9d)
2018-02-23 23:35:01 +00:00
AnyOldName3
6251e0519e Use CLSB results to reduce maximum shadow map distance when sensible. 2018-02-23 23:31:53 +00:00
scrawl
25a6a67508
Fix the optimizer messing up LOD node's children (Fixes #4301) 2018-01-29 19:44:12 +00:00
AnyOldName3
9f20aaccfb Add some more advanced settings to control shadows. 2018-01-25 16:08:34 +00:00
AnyOldName3
6ec893b618 Merge remote-tracking branch 'refs/remotes/upstream/master' 2018-01-22 15:54:13 +00:00
scrawl
bba9a8dd91
Don't update off-screen animations
Make flying creatures animate in-place when out of processing range
2018-01-11 01:49:35 +00:00
AnyOldName3
bf9a1ded63 Mark a function as override 2018-01-02 16:39:05 +00:00
AnyOldName3
c3e0398d1c Add settings 2017-12-27 02:32:17 +00:00
AnyOldName3
c192c851db Make disabling shadows disable their performance impact, too. 2017-12-26 23:51:50 +00:00
AnyOldName3
8957c92a36 Switch to a more industry-standard shadow map splitting scheme 2017-12-17 00:52:10 +00:00
AnyOldName3
7cce2d6f87 Implement a more sensible shadow map cascading system 2017-12-12 22:37:40 +00:00
AnyOldName3
98cd9fc144 Add preliminary support for global shader defines. 2017-11-22 20:07:07 +00:00
AnyOldName3
e201e359a9 Move Shadow to Components 2017-11-08 01:44:49 +00:00
scrawl
03554b2f4b Fix some style issues flagged by cppcheck 2017-10-15 17:06:58 +02:00
Miloslav Číž
380a5799dd use bbox as wrap range & apply to all particle systems 2017-10-14 21:42:19 +02:00
Miloslav Číž
33a1459b11 search for particle system by class name 2017-10-14 21:41:47 +02:00
scrawl
dca31b7ffa Remove redundant _boundingBoxComputed which no longer exists in osg master (Fixes #4075) 2017-09-04 19:35:42 +00:00
scrawl
2e58024f1c Fix intersections with Rig/MorphGeometry, was caused by an issue in the LineSegmentIntersector not respecting the cullingActive flag of a drawable. 2017-09-03 14:14:15 +00:00
scrawl
5e790b567e Fix node path issue
Needs to be set so that the 'cullingActive' flag of the node path's end can be checked
2017-09-01 22:12:40 +00:00
scrawl
4bef8260ab Add const qualifiers 2017-09-01 21:42:36 +00:00
scrawl
5d524a6a10 Add custom version of MorphGeometry replacing osgAnimation
Double buffering, custom bounding box and the update in the cull visitor (instead of update) are now all handled internally rather than needing hacks and/or callbacks.
2017-09-01 21:42:36 +00:00
scrawl
209e139aa8 Move double buffering implementation inside RigGeometry
The double buffering is an implementation detail so it should be handled as such, rather than mandating the scene graph to be structured in a certain way.

Override accept(NodeVisitor&) instead of using callbacks.
2017-09-01 21:42:34 +00:00
scrawl
45f7563a55 Revert "Revert "Check for a Geometry node when attaching bodyparts""
Issue with shaders has been fixed with b9931fb71c

This reverts commit a1e3fb7604.
2017-08-31 21:40:35 +00:00
scrawl
a1e3fb7604 Revert "Check for a Geometry node when attaching bodyparts"
This reverts commit 3fc8634206.
2017-08-29 22:40:19 +00:00
scrawl
3fc8634206 Check for a Geometry node when attaching bodyparts (Fixes #3957) 2017-08-29 12:55:42 +00:00
Allofich
42402976e3 Fixes for building in MSVC 2017-06-13 19:38:12 +09:00
Bret Curtis
f0b21cca22 use own inline hash_combine function 2017-06-12 00:32:28 +02:00
Bret Curtis
154d7cffa2 replace and purge boost::function 2017-06-09 19:08:53 +02:00
Bret Curtis
07f75e1104 replace boost::shared_ptr in extern and components 2017-06-09 19:08:53 +02:00
Ewan Higgs
38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 2017-06-09 16:49:25 +02:00
scrawl
8d84869432 Fix commit 8f71b65d38 (don't overwrite the previous user data)
This resulted in a crash/corruption because the KeyframeController, for performance reasons, does not check that the expected user data is there and of correct type.

(Fixes #3829)
2017-05-05 05:27:00 +02:00
scrawl
8f71b65d38 sceneutil/attach: inherit the UserDataContainer to avoid the resource cache from being cleared incorrectly 2017-04-14 15:04:53 +02:00
scrawl
3d58ba7301 Fix boolean test 2017-03-15 17:50:13 +01:00
scrawl
34130fc5cc Fix handling in LightListCallback when the node is not a Group 2017-03-14 19:27:55 +01:00
scrawl
b78a9f89af Refactor LightListCallback to allow for integration in custom Drawables. 2017-03-14 19:27:55 +01:00
scrawl
13a6070629 Remove warning spam in skeleton.cpp
If the root bone is missing, that is caused by all bones being missing which will have been logged already.
2017-03-13 02:48:22 +01:00
scrawl
c1b1d502ee Fix up commit 330e5fefd1 2017-03-04 21:48:31 +01:00
scrawl
4051018862 optimizer: fix FlattenStaticTransformsVisitor not respecting the is permissible callback 2017-03-04 21:48:31 +01:00
scrawl
29556a1802 More consistent wording of errors/warnings
A Warning indicates a potential problem in the content file(s) that the user told OpenMW to load. E.g. this might cause an object to not display at all or as intended, however the rest of the game will run fine.

An Error, however, is more likely to be a bug with the engine itself - it means that basic assumptions have been violated and the engine might not run correctly anymore.

The above mostly applies to errors/warnings during game-play; startup issues are handled differently: when a file is completely invalid/corrupted to the point that the engine can not start, that might cause messages that are worded as Error due to the severity of the issue but are not necessarily the engine's fault.

Hopefully, being a little more consistent here will alleviate confusion among users as to when a log message should be reported and to whom.
2017-03-04 21:48:31 +01:00
scrawl
706ac45c76 Fix missing particles caused by shallow copy of ParticleSystemController 2017-02-26 23:10:41 +01:00
scrawl
5caf53b6a3 optimizer: avoid reordering nodes
Fixes an osgParticle cloning issue.

(Fixes #3773)
2017-02-26 03:25:17 +01:00
scrawl
a95773beef Fix unnecessary copy of ParticleSystem in SceneUtil::CopyOp 2017-02-26 03:15:57 +01:00
scrawl
48e0f098ff Add missing copy of callbacks when a Transform is replaced by Group
(Fixes #3770)
2017-02-24 07:38:03 +01:00
scrawl
330e5fefd1 optimizer: consider a Group with more than one child redundant as well
While there could be some value in this hierarchy (i.e. improved culling), we don't know if this is being used sensibly; and using a 'flat' hierarchy helps other optimizations.
2017-02-24 02:58:41 +01:00
scrawl
e4c12e5e56 optimizer: don't merge Geometry that has transparency sorting enabled 2017-02-24 02:58:27 +01:00
scrawl
ebfd845eae optimizer: run MERGE_GEOMETRY after removing redundant nodes 2017-02-23 23:28:50 +01:00
scrawl
43f31d6e54 optimizer: fix MERGE_GEOMETRY to work with Geometries not attached to a Geode 2017-02-23 23:28:50 +01:00
scrawl
f2a323238f optimizer: merge groups as part of REMOVE_REDUNDANT_NODES 2017-02-23 23:28:50 +01:00
scrawl
af716d4b61 optimizer: remove hardcoded condition in RemoveRedundantNodesVisitor 2017-02-23 23:28:50 +01:00
scrawl
698738c649 optimizer: use asXYZ() instead of dynamic_cast 2017-02-23 23:28:50 +01:00
scrawl
f7cb4bd245 optimizer: remove some cruft 2017-02-23 23:28:50 +01:00
scrawl
e33829d493 Add fork of osgUtil::Optimizer with backported fixes that have not been released yet
Remove optimizers that won't be used.
2017-02-23 23:28:50 +01:00
scrawl
305cccd263 Don't print Geometry data (vertices, triangles, etc.) in showscenegraph 2017-02-23 23:28:50 +01:00
scrawl
c231b06320 Remove boneOffset node after using it 2017-02-23 23:28:50 +01:00
scrawl
8f79fa3d72 Add resource statistics panel opened with F4 2017-02-22 14:28:45 +01:00
scrawl
4aa40d16bc Increase the importance of light radius when sorting lights (Bug #2759) 2017-02-21 04:32:59 +01:00
scrawl
67e4a7e37b Change some osg::clone's to direct copy constructor to avoid dynamic_cast overhead 2017-02-09 04:51:20 +01:00
scrawl
839928e210 Fix light data being reset for the wrong light 2017-02-09 02:46:30 +01:00
scrawl
a46593fa74 Add PreloadItem::abort() to avoid no longer required cells from blocking the work thread 2017-02-09 01:08:07 +01:00
scrawl
c00532d82d Add LightStateCache to avoid redundantly setting the same gl_Light
Normally, osg::State would do this for us (via lastAppliedAttribute), but since we're using a custom StateAttribute to apply all lights at once, we have to track ourselves.

Further reduction of GL calls in a typical scene by ~2%
2017-02-07 23:37:57 +01:00
scrawl
4d4dc1b9c1 Add specialized DisableLight state attribute for more efficient undoing of light state
Seems to reduce # of GL calls by 10-15% in a typical scene.
2017-02-07 23:01:36 +01:00
scrawl
a1069dce3c Change UnrefQueue to accept osg::Referenced instead of osg::Object 2017-02-04 02:24:42 +01:00
scrawl
33e654f94d Add explicit handling of most commonly used nodes to NodeVisitors to avoid excessive virtual function calls 2017-02-04 02:16:26 +01:00
scrawl
767eba941f Speed up finding of attachment node by using the cached nodeMap 2017-02-03 23:15:37 +01:00
scrawl
a76d693627 Speed up ControllerVisitor by skipping sub graphs that have no ChildrenRequiringUpdateTraversal() 2017-02-03 23:10:14 +01:00
scrawl
30b101b175 Fix build error in OSG_USE_FLOAT_MATRIX=OFF mode due to a double implicit conversion to double (pun doubly intended) 2017-02-03 06:49:34 +01:00
scrawl
84a92e665c Improve performance in RigGeometry by optimizing for the most common case of identity geomToSkelMatrix 2017-02-03 02:18:44 +01:00
scrawl
53e4db8a8f Add dummy serializer for CameraRelativeTransform to allow serializing content of Sky Root 2017-02-02 21:57:18 +01:00
scrawl
34deb6e7b1 Add 'showSceneGraph' command to export the scene or a particular object to .osgt for debugging purposes 2017-02-01 06:00:14 +01:00
scrawl
eae35af13d Check if the bounding box changed before calling dirtyBound() 2016-12-17 00:23:22 +01:00
scrawl
cca75499ee Clear the Skeleton's bone cache when a node is added/removed (Fixes #3663) 2016-12-16 20:09:20 +01:00
scrawl
c0faeea938 RigGeometry check if mesh has normals (Fixes #3667) 2016-12-15 22:39:21 +01:00
MiroslavR
11565b5966 Make actors with non-portable lights in inventory glow (Closes #2042, #3338) 2016-10-08 23:17:12 +02:00
scrawl
513e1da8a3 Remove unneeded casts 2016-08-14 16:44:11 +02:00
Aesylwinn
5753f52b47 Move water mesh + simple state generation to components library. 2016-08-05 13:25:05 -04:00
scrawl
8f62ea2e80 Fix for "RigGeometry rendering with no skeleton" errors 2016-07-02 20:19:55 +02:00
scrawl
d5f497c47d Pass the node path instead of the node visitor 2016-07-02 19:27:19 +02:00
scrawl
6fa95e72c5 Pass the traversal number instead of the node visitor 2016-07-02 19:26:11 +02:00
scrawl
824cd3be22 Do not set _boundingBoxComputed which is no longer used 2016-06-14 22:25:25 +02:00
Aesylwinn
b83f522ecd Changes to color scheme, slight change to drag indicator,
change tooltip description.
2016-05-29 13:26:29 -04:00
Aesylwinn
1781aaaa27 Drag indicator. 2016-05-18 12:17:26 -04:00
Aesylwinn
32ba5bf8b8 Initial pathgrid editting, support for selection and movement. 2016-05-12 19:35:49 -04:00
scrawl
17a0353a85 Fix forward declaration mismatch 2016-05-10 17:36:25 +02:00
Aesylwinn
14ae232938 Remove now unnecessary factory class.
It was originally used for storing normals, but that functionality
was removed.
2016-05-03 16:13:23 -04:00
Aesylwinn
b11f5b2717 Make edges differently colored. 2016-05-03 15:06:28 -04:00
Aesylwinn
0eb863d8fc Change color to blue to match the pathgrid visibility selector in the
editor and slightly increase the scaling.
2016-05-03 03:29:34 -04:00
Aesylwinn
7f0cc6e583 Add a color gradiant to pathgrid nodes to make them less of an eyesore. 2016-05-03 03:29:30 -04:00
Aesylwinn
3d26ff08c4 Get rid of lighting. 2016-05-03 03:29:07 -04:00
Aesylwinn
d141672b53 Pathgrid geometry creator 2016-05-02 22:09:48 -04:00
scrawl
2f8be401cc Add the unref work items to the front of the workqueue (Bug #3273)
Ensures that memory still gets freed even if the workqueue is overloaded.
2016-03-29 00:27:56 +02:00
scrawl
8052225460 Remove leftover call to setTexCoordArrayList 2016-03-23 22:56:04 +01:00
scrawl
cc0afe901f Store a pointer to tangents array to avoid potential type casting issue 2016-03-23 17:03:04 +01:00
scrawl
d1f6169889 Add special handling of RigGeometry tangents in ShaderVisitor 2016-03-23 16:48:41 +01:00
scrawl
95e80e7eff RigGeometry: don't directly modify the primitive set list
This is to ensure that an element buffer object will be assigned to the primitive sets if necessary.
2016-03-23 00:10:22 +01:00
scrawl
c73ec71123 Revert "Store the RigGeometry's source vertices and normals directly"
This reverts commit 7a347e3483.
2016-03-22 23:28:57 +01:00
scrawl
60c8c4fdda Revert "Animate tangents in RigGeometry"
This reverts commit 9cf963b751.
2016-03-22 23:28:52 +01:00
scrawl
9cf963b751 Animate tangents in RigGeometry 2016-03-22 22:14:35 +01:00
scrawl
7a347e3483 Store the RigGeometry's source vertices and normals directly 2016-03-22 22:01:56 +01:00
scrawl
d986b1a48b Add comment 2016-03-11 19:28:53 +01:00
scrawl
1abb77f8a1 Cleanup 2016-03-11 19:18:51 +01:00
scrawl
9f03982e0b Use a dedicated VBO for RigGeometry's vertices and normals
The VBO used by the source geometry's arrays may be unintentionally shared with other RigGeometries.

The vertices and normals are the only attributes that are modified at all, so using a dedicated VBO for these should improve performance further.
2016-03-11 19:08:48 +01:00
scrawl
50b8260a39 Disable VBOs in RigGeometry while investigating a crash possibly related to commit cda8a88f0d 2016-03-11 18:21:55 +01:00
scrawl
4eb090a8d0 Set the RigGeometry vertex buffer object usage to GL_DYNAMIC_DRAW 2016-03-11 16:09:48 +01:00
scrawl
174dd82894 Manually apply the osg::Light state
Reduce the amount of virtual function calls. Don't use the osg::Light's lightNum. Don't set spotlight state that we're not using (yet).
2016-03-11 15:43:20 +01:00
scrawl
58e0e8bd4e Enable vertex buffer objects in RigGeometry 2016-03-11 01:39:09 +01:00
scrawl
f898bf493f Don't use Geodes 2016-03-10 13:17:01 +01:00
scrawl
137dde7cf8 Include cleanup 2016-03-10 12:59:17 +01:00
scrawl
0df975a4d7 Properly detach nodes in CopyRigVisitor (Fixes #3234) 2016-03-06 11:33:07 +01:00
scrawl
563807ee53 Share the StateSet used to invert front face 2016-03-02 13:33:44 +01:00
scrawl
8791063110 Fix "RigGeometry rendering with no skeleton" warnings in rare cases 2016-02-29 18:20:56 +01:00
scrawl
1e5b4bea0a Don't create an unnecessary osg::Group when copying over a rig 2016-02-29 17:50:18 +01:00
scrawl
90a99991d1 Use empty() instead of !size() 2016-02-22 19:06:12 +01:00
scrawl
3e854a84a2 Slightly more efficient applying of light state 2016-02-18 19:37:57 +01:00
scrawl
f93b7ec943 Fix light state issue
GLSL does not respect gl_Disable(GL_LIGHTX), so we have to set unused lights to zero.

Sadly, this change makes the applying of the modelView matrix less efficient. So far I couldn't find a better solution, osg's state tracker keeps getting in the way. :(
2016-02-18 19:37:57 +01:00
scrawl
9376811213 Vertex lighting shader 2016-02-18 19:37:57 +01:00
scrawl
c4d38bb42d Fix clang analyzer warnings 2016-02-16 19:17:04 +01:00
scrawl
5824619a95 Clean up includes 2016-02-12 19:28:10 +01:00
scrawl
8b596dfcbe Remove support for OSG 3.2
Since commit e8662bea31, we're using OSG functionality that contains an unfixed crash bug in version 3.2. The bug is fixed in version 3.4 (OSG commit 6351e5020371b0b72b300088a5c6772f58379b84)
2016-02-12 14:46:45 +01:00
Marc Zinnschlag
da6dcfc49e Merge remote-tracking branch 'scrawl/resource' 2016-02-10 16:23:38 +01:00
scrawl
afe533e670 Accept a const Object in UnrefQueue 2016-02-09 19:00:30 +01:00
scrawl
40a6e05e17 Use a deque instead of vector in UnrefQueue 2016-02-09 16:09:55 +01:00
scrawl
d11c2864df Introduce UnrefQueue to handle the deleting of no longer needed objects in the background thread 2016-02-09 15:45:35 +01:00
scrawl
84f01b7527 Remove unneeded forward declaration 2016-02-08 16:27:28 +01:00
scrawl
b7e69cbc64 Refactor WorkQueue, merge WorkTicket and WorkItem
Allow the caller to hold on to the WorkItem. This makes it possible for a derived WorkItem to store the result of the work within the WorkItem itself.
2016-02-06 22:42:45 +01:00
scrawl
e02f35264f Work around OSG 3.2 not respecting the DEEP_COPY_CALLBACK flag (Fixes #3183) 2016-02-06 15:08:12 +01:00
scrawl
8360cccce7 Don't clone Drawable UpdateCallbacks twice
The Drawable copy constructor takes care of that already.
2016-02-01 21:02:48 +01:00
scrawl
aec8c38461 Move observer_ptr include where it belongs 2016-01-25 21:03:33 +01:00
Tobias Kortkamp
0659687bfb Some fixes for building on FreeBSD 2016-01-25 14:13:16 +01:00
scrawl
458a305bff OpenCS: add lighting mask 2016-01-11 23:14:43 +01:00
scrawl
e1c7165bfb Fix bounds calculation for addLight to a transform node 2016-01-11 23:14:43 +01:00
scrawl
93cc08a09c Lighting fix for LightListCallbacks attached to a Transform node 2016-01-11 23:10:16 +01:00
scrawl
3089aeccc4 Factor out SceneUtil::addLight 2016-01-11 23:10:16 +01:00
scrawl
438b30d6f0 Move configureLight to a separate file 2016-01-11 23:10:16 +01:00
scrawl
daa94cc50e Fix cppcheck warnings 2016-01-03 20:19:38 +01:00
scrawl
0597c8fd9c Pass a Vec4f by reference 2016-01-03 16:43:20 +01:00
scrawl
624809c8dc Minor fix for error handling in skeleton.cpp 2015-12-08 16:50:54 +01:00
scrawl
e39f49a88f OSG extensions namespace fixes 2015-12-06 15:27:43 +01:00
scrawl
c60f4ba7bd Make RigGeometry bone references case-insensitive (Fixes #3058) 2015-12-05 15:02:35 +01:00
scrawl
258f7a2b42 LightController fixes 2015-12-05 00:38:06 +01:00
scrawl
4a9b37aa53 Fix copy constructor issue 2015-12-04 18:08:32 +01:00
scrawl
c442af09c5 Write more documentation for the lighting system 2015-12-04 18:08:32 +01:00
scrawl
8e9571d155 Double buffer the light StateAttributes and StateSets
Fixes a race condition where the position of a light could jump a frame ahead.
2015-12-04 00:06:22 +01:00
scrawl
1f8ee9b8d1 StateSetUpdater: use the frameNumber
More robust in case a node is updated twice in the same frame (e.g. because it has multiple parents).
2015-12-03 23:46:25 +01:00
scrawl
eb458bf9c8 Fix inactive RigGeometry not rendering correctly 2015-12-03 19:49:45 +01:00
scrawl
1b77428c59 Use const reference, thanks ace13 2015-11-24 03:42:35 +01:00
scrawl
94e8560bf8 RigGeometry: do not allocate new NodePath every frame 2015-11-22 20:01:09 +01:00
scrawl
6d5aa272fc RigGeometry: do not update the geomToSkelMatrix more than once per frame 2015-11-22 19:54:27 +01:00
scrawl
75a464f7ec Fix a typo 2015-11-22 19:54:27 +01:00
scrawl
fc7456e0a1 Explicitely opt for float matrices in performance critical places 2015-11-22 19:54:27 +01:00
scrawl
62169a7039 Use a single-precision PositionAttitudeTransform in speed critical places 2015-11-22 19:54:26 +01:00
scrawl
3bd2aaddea Adjust PulseSlow light controller (Fixes #1963) 2015-11-18 23:14:01 +01:00
scrawl
21e25f4756 Use the traversalNumber as frame number 2015-11-16 20:03:45 +01:00
scrawl
054c3eb24e Do not deep copy PrimitiveSets when build with OSG 3.5 2015-11-13 20:39:44 +01:00
scrawl
0409e5a043 Use OSG_VERSION_GREATER_EQUAL / LESS_THAN rather than MIN_VERSION_REQUIRED (cosmetic change) 2015-11-10 18:28:58 +01:00
scrawl
f1ac408f35 Place Drawables directly in the scene graph when built with OSG 3.4
OSG 3.4 adds the ability to place Drawables directly in the scene graph, without a Geode decorating them. Leveraging this should give a small performance boost, because the redundant Geodes increase culling overhead.

There is still an oustanding issue with the RemoveDrawableVisitor no longer working correctly, because Drawables can have multiple parents.
2015-11-10 18:23:42 +01:00
scrawl
35459f20d5 Refactor lighting mask 2015-11-10 17:23:12 +01:00
scrawl
bd8332d2b0 Remove default copyop argument for nodecallback copy constructors
Works around a compiler warning with OSG 3.4:

warning: base class 'class osg::Callback' should be explicitly initialized in the copy constructor [-Wextra]

With no default argument for osg::CopyOp&, the compiler no longer sees the function as a real copy constructor and stops warning about the missing virtual initializations.

We don't care about this warning because there is nothing interesting to initialize in the osg::NodeCallback base anyway.

A proper fix for the warning would require to inserting OSG_VERSION conditional compiling all over the place, that is as long as we are still supporting OSG 3.2.
2015-11-09 18:57:17 +01:00
scrawl
1200ff9186 RigGeometry: fix incorrect bounding box in the first frame
The default computeBound() was overriding the manually set bounding box.
2015-11-09 18:31:41 +01:00
scrawl
0210b87ffc Revert "Fix LightSource crash"
This reverts commit f336c6db87.

Root cause should be fixed in next commit.
2015-11-06 23:14:27 +01:00
scrawl
c996702b56 Fix some uninitialised variables found by static analysis 2015-11-04 20:34:50 +01:00
scrawl
c23609e22b Cache the light list in LightListCallback
When multiple cameras are rendering, the later cameras can reuse the light lists from the first camera.
2015-11-04 00:19:15 +01:00
scrawl
fd1ccd21ff Disable freezeOnCull for weather particles 2015-11-02 23:49:22 +01:00
scrawl
5ca0ae5232 Don't add the same AlphaFader to multiple nodes 2015-11-02 23:38:34 +01:00
scrawl
f336c6db87 Fix LightSource crash 2015-10-29 00:51:35 +01:00
scrawl
49df6b7450 LightManager: fix incorrect view matrix for RELATIVE_RF cameras 2015-10-23 21:25:56 +02:00
scrawl
6dff11f847 Duplicate code fix 2015-10-23 18:16:26 +02:00
scrawl
8552a9d82c Add multiple camera support to LightManager 2015-10-23 01:58:22 +02:00
scrawl
8e69c80bf6 Add framenumber checks in various cull callbacks, so we don't update more than once per frame when multiple cameras are used 2015-09-26 01:21:33 +02:00
scrawl
f7e5a40143 Fix typo 2015-09-21 17:58:57 +02:00
scrawl
e9acd135a6 Update todo comment 2015-08-30 20:43:39 +02:00
scrawl
cda8a88f0d Use DEEP_COPY_PRIMITIVES to work around problem in osg::Geometry copy constructor (Bug #2754) 2015-08-30 20:00:37 +02:00
scrawl
b3f5ac5dbb Include cleanup 2015-07-25 02:11:49 +02:00
scrawl
49c07de773 Merge pull request #643 from ace13/win-build-fix
Fix build error and a pair of warnings
2015-07-05 22:24:24 +02:00
Alexander "Ace" Olofsson
aaaee74a4d Fix the comments 2015-07-05 21:56:04 +02:00
scrawl
631cec7304 Take the radius of lights into account when sorting 2015-07-02 20:46:34 +02:00
scrawl
43f9c7f295 Skip the Update traversal for inactive skeletons 2015-06-30 03:25:30 +02:00
scrawl
aad8e7b6d0 Light culling fix 2015-06-15 19:37:44 +02:00
scrawl
18f4eaa8dc Preliminary handling for overflowing light lists 2015-06-15 18:56:40 +02:00
scrawl
acf9fc2d37 Enable per-frame light list updates (Bug #2638, Bug #2654)
The performance impact isn't so big anymore since the last commit.
2015-06-15 18:15:26 +02:00
scrawl
1d198a5592 Keep the light list StateSet cache for more than one frame 2015-06-15 18:09:01 +02:00
scrawl
b204396b57 Minor fix 2015-06-14 21:04:59 +02:00
scrawl
a1e74a35a2 Revert "Use the WorkQueue to update skinning"
This reverts commit d52d0d9640.

Moving to branch
2015-06-10 19:08:56 +02:00
scrawl
9c86d4f8bc Race condition fix 2015-06-10 19:02:33 +02:00
scrawl
d52d0d9640 Use the WorkQueue to update skinning 2015-06-10 18:16:02 +02:00
scrawl
cc71e894e1 Add WorkQueue class 2015-06-10 18:15:31 +02:00
scrawl
9c9b83f8e2 Changes to compile with osg-svn 3.3.8 2015-06-07 23:51:54 +02:00
scrawl
5a7f2a4f1f Restore light attenuation settings 2015-06-02 17:02:56 +02:00
scrawl
01944c33f5 Basic water rendering 2015-06-02 16:35:35 +02:00
scrawl
c85764b654 Wireframe mode 2015-06-01 17:02:44 +02:00
scrawl
fd50be0fb8 Restore various gameplay 2015-05-30 01:00:24 +02:00
scrawl
6231cd8557 RigGeometry clone fix 2015-05-30 00:59:34 +02:00
scrawl
a56d0e9cc3 ControllerVisitor fix 2015-05-29 23:39:52 +02:00
scrawl
668d365ef9 MorphGeometry copy fix 2015-05-29 21:47:43 +02:00
scrawl
5de24552a8 Leak fix 2015-05-26 19:12:29 +02:00
scrawl
3dcb167066 Map rendering 2015-05-26 16:40:44 +02:00
scrawl
da24e298ee Fix -Wreorder warnings 2015-05-23 22:44:00 +02:00
scrawl
7882c3d7f0 Fix incorrect rotation for meshes with BoneOffset 2015-05-20 04:09:21 +02:00
scrawl
8d033f0558 Fix UpdateRigBounds not being copied properly 2015-05-20 03:12:42 +02:00
scrawl
8b768f4377 Minor fix for behaviour with non-existing LightManager 2015-05-18 21:06:42 +02:00
scrawl
b6cb73e6e8 Fix deep copying of controllers
This fixes the cell loading crash.
2015-05-14 15:07:58 +02:00
scrawl
65f0195c71 Readded animated collision shape support 2015-05-12 16:26:11 +02:00
scrawl
15bdb7db01 transformBoundingSphere optimization 2015-05-01 01:44:21 +02:00
scrawl
a98dc78cc5 Bounds fix 2015-04-30 15:46:16 +02:00
scrawl
83c6ba97c0 Disable skinning updates for actors beyond the AI processing distance 2015-04-30 00:10:24 +02:00
scrawl
63b69db617 Port skeleton based bounding boxes to the new skinning system
Not sure if going to keep this, there's a noticable performance impact.
2015-04-27 15:41:34 +02:00
scrawl
b4a06bd78d Improve skinning performance 2015-04-25 19:32:07 +02:00
scrawl
09742d5b95 Animation playback works, no movement accumulation yet 2015-04-23 20:41:31 +02:00
scrawl
12f3198f68 Node name lookups should be case insensitive
Concerns "AttachLight", "BoneOffset" and equipment part attachment points, that are all case insensitive in vanilla MW.
2015-04-23 17:15:30 +02:00
scrawl
cd7808fc11 Cleanup in preparation for animation port
Scrapped previous idea for multiple animation sources, better approach incoming.
2015-04-22 23:16:08 +02:00
scrawl
8c810e3620 Move rng to components 2015-04-22 17:58:55 +02:00
scrawl
04accb7652 Add LightController 2015-04-22 17:37:39 +02:00
scrawl
5fbcf8a859 Mesh filtering fix 2015-04-22 16:59:23 +02:00
scrawl
a254877abe Clone fix 2015-04-21 22:53:28 +02:00
scrawl
28643660d3 Change triangle indices to unsigned 2015-04-21 20:56:16 +02:00
scrawl
102eadf91c Add some comments 2015-04-21 20:42:50 +02:00
scrawl
eaa4316ff8 Move skinning code to SceneUtil 2015-04-21 20:30:48 +02:00
scrawl
bd88758962 Use the new skinning system in OpenMW 2015-04-21 18:54:03 +02:00
scrawl
68f93294da Port EffectManager 2015-04-19 17:55:56 +02:00
scrawl
f7d2a28930 Port BoneOffset 2015-04-19 14:25:36 +02:00
scrawl
edc5cad79e Port Animation::addEffect 2015-04-19 01:57:52 +02:00
scrawl
8f6d4fb3e0 Fix filtering bug 2015-04-16 01:26:58 +02:00
scrawl
57fd18b161 Fix frontface bug 2015-04-15 22:43:53 +02:00
scrawl
c334a76a6f Fix skinning bug 2015-04-15 22:38:43 +02:00
scrawl
c516e897ee Move Controller base classes to SceneUtil, add visitor to assign ControllerSources 2015-04-14 17:51:46 +02:00
scrawl
de2c85e0f8 Port nifloader to the more efficient StateSetController 2015-04-14 16:41:06 +02:00
scrawl
5dd1ab24fe More efficient StateSetController, beginnings of sky rendering 2015-04-14 15:58:16 +02:00
scrawl
987e923790 LightManager optimization 2015-04-12 19:44:48 +02:00
scrawl
61aaf0cf70 Attach light lists to the object base nodes instead of each renderable
Apparently that is how Ogre worked (on the SceneNode) so let's roll with it for now. Have not tested yet what MW does.
2015-04-12 18:03:36 +02:00
scrawl
c92592493e OpenMW: create a window and render the starting cell(s) 2015-04-12 15:38:30 +02:00
scrawl
b0ea51a5c8 Colour conversion utility 2015-04-11 20:09:40 +02:00
scrawl
591a35b8d7 *very* early version of the LightManager 2015-04-10 23:16:17 +02:00
scrawl
5162e9c09e Add comment 2015-03-29 19:39:22 +02:00
scrawl
a7272b73d0 Add utility for assembling body parts / equipment 2015-03-29 19:39:22 +02:00
scrawl
99e1720980 Add SceneManager and clone utility 2015-03-26 18:02:51 +01:00