Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
   Copyright (c) 2014 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy of this software
   and associated documentation files (the "Software"), to deal in the Software without restriction,
   including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _NAV_MESH_DEBUG_DRAW_H_
#define _NAV_MESH_DEBUG_DRAW_H_

#include <DebugUtils/Include/DebugDraw.h>
#include "Hardware/Video/Headers/RenderAPIEnums.h"
#include "Hardware/Platform/Headers/PlatformDefines.h"

class IMPrimitive;
class RenderStateBlock;

namespace Navigation {
    /// Convert a Rcast color integer to RGBA components.
    inline void rcCol(U32 col, U8 &r, U8 &g, U8 &b, U8 &a) {
        r = col % 256; col /= 256;
        g = col % 256; col /= 256;
        b = col % 256; col /= 256;
        a = col % 256;
    }

    class NavMeshDebugDraw : public duDebugDraw {
        public:
            NavMeshDebugDraw();
            ~NavMeshDebugDraw();

            void depthMask(bool state);
            void paused(bool state);
            void overrideColor(U32 col);
            void beginBatch();
            void endBatch();

            void begin(duDebugDrawPrimitives prim, F32 size = 1.0f);
            void vertex(const F32 x, const F32 y, const F32 z, U32 color);
            void end();

            inline void setDirty(bool state)       { _dirty = state; }
            inline bool isDirty()            const { return _dirty;  }
            inline bool paused()             const { return _paused; }
            inline void cancelOverride()           { _overrideColor = false; }
            inline void texture(bool state) {}
            inline void vertex(const F32* pos, U32 color)                { vertex(pos[0], pos[1], pos[2], color); }
            inline void vertex(const F32* pos, U32 color, const F32* uv) { vertex(pos[0], pos[1], pos[2], color); }         
            inline void vertex(const F32 x, const F32 y, const F32 z, U32 color, const F32 u, const F32 v) {
                vertex(x, y, z, color);
            }

        private:
            PrimitiveType _primType;
            IMPrimitive* _primitive;
            size_t  _navMeshStateBlockHash;
            U32  _vertCount;
            U32  _color;
            bool _overrideColor;
            bool _dirty;
            bool _paused;
    };
};
#endif

Commits for Divide-Framework/trunk/Source Code/AI/PathFinding/NavMeshes/Headers/NavMeshDebugDraw.h

Diff revisions: vs.
Revision Author Commited Message
286 Diff Diff IonutCava picture IonutCava Fri 18 Jul, 2014 16:32:03 +0000

[Ionut] [[BR]]

    • very buggy commit ** [[BR]]

- New rendering pipeline: [[BR]]
— Bumped OpenGL version to 4.4 [[BR]]
— Command based rendering. GFXDevice dispatches rendering commands to their respective buffers [[BR]]
— State changing is exclusively controlled by the GFXDevice class [[BR]]
— Material properties and transform matrices are stored in shader storage buffers that are updated after culling and uploaded once per RenderPass. Objects use drawIDs to index data in shaders [[BR]]
— Removed all custom matrices and other, per shader, bind data [[BR]]
— Removed per node light data. Light culling and shader buffers will replace the old light management system [[BR]]
— Framebuffers now use the Texture class for attachments [[BR]]
— Sampler objects now work like RenderStateBlocks. GL_API handles them and stores them in a hash indexed map [[BR]]
— Removed “prepareMaterial” calls. Pre-draw material setup is now only limited to texture binding [[BR]]
— Moved immediate mode emulation and primitive rendering from API level to GFXDevice level [[BR]]
— Framebuffer rendering must be completed with a call to end() to ensure proper MSAA resolve (asserts, otherwise) [[BR]]
- Fixed hash code generation for RenderStateBlock (and now, glSamplerObject) using boost::hash_combine [[BR]]
- Temporarily disabled XML caching for materials [[BR]]

273 Diff Diff IonutCava picture IonutCava Wed 11 Jun, 2014 20:34:00 +0000

[Ionut] [[BR]]
- Improved batching part2: [[BR]]
— Moved all bone transformation matrices upload from uniform functions in SceneNode to Shader Storage Buffers in AnimationController class with updates controlled by SceneGraphNode’s AnimationComponent [[BR]]
-— No double-buffering or efficient mapping of data yet. Just raw buffer updates [[BR]]
— Replaced all RenderStateBlock* pointers with I64 hash values [[BR]]
-— Will be used later in draw commands as per-shader state hash [[BR]]
— Moved getShaderProgram from Material to Material::ShaderInfo [[BR]]
-— Improved redundant uniform checks [[BR]]
— Improved texture unit changing in case of redundant texture bind case (i.e. skip changing the texture unit) [[BR]]
[[BR]]
- Improved float and double comparison functions using algorithms described in http://randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/ [[BR]]
- Added a new utility function, DIVIDE_ASSERT, to more easily bind an assert check with a specific message [[BR]]
- Added missing files from Forward+ renderer’s initial code [[BR]]

267 Diff Diff k1ngp1n picture k1ngp1n Wed 28 May, 2014 11:08:12 +0000

[Ionut] [[BR]]
- Improved texture handling: [[BR]]
— No more texture unbind (except when clearing the frame state) [[BR]]
— Moved texture bind checking to the GL_API class [[BR]]
- Fixed a crash related to vegetation loading due to compiler optimizations [[BR]]
- removed all “releaseMaterial” functions as they are no longer needed [[BR]]

248 Diff Diff k1ngp1n picture k1ngp1n Mon 24 Feb, 2014 22:35:21 +0000

[Ionut][[BR]]
- Added a GenericVertexData class that can be used to fill VBOs with generic data and upload it to the GPU (and render it, either direct or instanced) [[BR]]
- Added a basic (soft) particle system [[BR]]
- Reworked memory allocation logging [[BR]]
- Improved transparency detection for textures on load [[BR]]

221 Diff Diff k1ngp1n picture k1ngp1n Wed 08 Jan, 2014 18:50:02 +0000

[Ionut] [[BR]]
- Merged branch “Shadows And Animations” back into trunk [[BR]]
- Added DoxygenGUI project file [[BR]]

  • Buggy *
179 Diff Diff k1ngp1n picture k1ngp1n Sun 17 Nov, 2013 14:46:01 +0000

[Ionut] [[BR]]
- Bug fix with initial unit positioning (Unit.cpp -> moveTo(...) )[[BR]]
- Bug fix with nav mesh debug draw (could not be toggled off) [[BR]]
- Better float comparison code [[BR]]
- Save and Load nav mesh extents from file [[BR]]

171 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Nov, 2013 18:15:06 +0000

-Replaced all tabs with spaces [[BR]]

163 Diff Diff k1ngp1n picture k1ngp1n Thu 18 Jul, 2013 12:24:26 +0000

[Ionut] [[BR]]
- Fixed a rendering bug with the previous terrain rendering system (number of strips was not calculated correctly. had to add the primitive restart indices to the list as well) [[BR]]
- Fixed a rendering bug with the previous double sided Quad3D patch (water planes should not be double sided. The first parameter of the bool mask of the resource descriptor for water planes now controls whether the Quad will be single or double sided) [[BR]]
- NavMesh debug draw now uses a caching system for rendering instead of re-submitting the same geometry every frame [[BR]]
— Fixed a bug that prevented GLIM primitives to be cached if they had “canZombify” set to false [[BR]]
- Navigation meshes are now saved and loaded from file on creation. Delete the “nm” file from the navMeshes subfolder to recreate a navigation mesh for a scene. [[BR]]
- LightManager is now a FrameListener. ShadowMap generation is called with the “FramePreRenderEnd” event [[BR]]
- Terrain NavMesh uses the lowest LoD possible for now to improve creation times until all bugs are resolved [[BR]]
- Geometry importer now uses the “replace” operation for the base texture of objects [[BR]]
- glUniformBufferObjects are now a little less dependent on the GLM library [[BR]]
- Primitive restart is now toggled on or off at each VAO draw call [[BR]]
- Some GFXDevice inlining [[BR]]

160 Diff Diff k1ngp1n picture k1ngp1n Wed 10 Jul, 2013 17:07:04 +0000

[Ionut] [[BR]]
- Changed licensing from LGPL to the MIT license [[BR]]
— Code can now be used in non-commercial or commercial closed or open source projects [[BR]]

158 k1ngp1n picture k1ngp1n Sun 07 Jul, 2013 17:52:10 +0000

[Ionut] [[BR]]
- Fixed a bug with NavMesh generation : triangles were using decremented indices (the original code used OBJ meshes as input, and those use ‘1’ as the first index instead of ‘0’) [[BR]]
- Fixed NavMesh debug draw (BeginBatch/EndBatch was called with every ‘Begin/End’ command from NavMeshDebugDraw thus reseting the IMEmulation primitive data) [[BR]]