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
#include "Core/Resources/Headers/ResourceLoader.h"
#include "Core/Resources/Headers/ResourceCache.h"
#include "Geometry/Shapes/Headers/Mesh.h"
#include "Geometry/Importer/Headers/MeshImporter.h"

namespace Divide {

template<>
Resource_ptr ImplResourceLoader<Mesh>::operator()() {
    MeshImporter& importer = MeshImporter::instance();

    Mesh_ptr ptr;
    Import::ImportData tempMeshData(_descriptor.getResourceLocation());
    if (importer.loadMeshDataFromFile(tempMeshData)) {
        ptr = importer.loadMesh(_descriptor.getName(), tempMeshData);
    } else {
        //handle error
        DIVIDE_UNEXPECTED_CALL(Util::StringFormat("Failed to import mesh [ %s ]!",
                               _descriptor.getResourceLocation()).c_str());
    }

    if (!load(ptr) || !ptr) {
        ptr.reset();
    } else {
        if (_descriptor.getFlag()) {
            ptr->renderState().useDefaultMaterial(false);
        }
    }

    return ptr;
}

};

Commits for Divide-Framework/trunk/Source Code/Core/Resources/ConcreteLoaders/MeshLoaderImpl.cpp

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

709 Diff Diff IonutCava picture IonutCava Thu 19 May, 2016 16:21:46 +0000

[IonutCava]
- Massive rewrite of the resource system:
— ResourceCache now uses a map of weak pointers and passes shared pointers to the call point of CreateResource
— RemoveResource is no longer needed, but resource based smart pointers use a custom deleter that calls unload()
— Keep a shared_ptr of the resource in the entity that needs it and pass shared_ptr references from getter methods
-— All of this removed the need for calls to RemoveResource, REGISTER_TRACKED_DEPENDENCY and UNREGISTER_TRACKED_DEPENDENCY reducing the number of mutex locks and atomic exchanges
- Singleton cleanup:
— Removed ShaderManager singleton and merged it’s data and responsibilities in static methods in both ShaderProgram and Shader classes.
Explanation: Due to the complex interdependency chains in the system, copying, updating, tracking the cache in a thread safe way became a lot more slower than a straight forward smart pointer based implementation. (e.g. scene graph nodes have 3d objects and material instances, 3d objects have materials, materials have textures and shaders, etc)

692 Diff Diff IonutCava picture IonutCava Wed 27 Apr, 2016 16:24:26 +0000

[IonutCava]
- Resource system cleanup:
— Resource name and resource file location (if any) is now passed only via explicit constructors! (ResourceDescriptors already contain this data, so why use setters?)
- Fix a bug with ortho projection matrix calculation (set m[3][3] to 1. this was skipped when the identity() call was changed to zero() in the ortho() function)
— This also fixed text rendering

670 Diff Diff IonutCava picture IonutCava Wed 06 Apr, 2016 16:21:35 +0000

[IonutCava]
- getInstance() renamed to instance() for simplicity (should really go away altogether, but that’s a different issue)
- some particle emitter threading updates

567 Diff Diff IonutCava picture IonutCava Sun 15 Nov, 2015 18:37:02 +0000

[IonutCava]
- Reduce some virtual function call overhead:
— Remove HardwareResource and merge it’s responsibilities back into Resource
— GFXDevice class doesn’t need to inherit from RenderAPIWrapper as it’s not a rendering API

519 Diff Diff IonutCava picture IonutCava Mon 05 Oct, 2015 16:04:47 +0000

[IonutCava]
- More separation between DVDConverter and MeshImporter:
— DVDConverter is no longer a singleton. Multiple converters can be used at the same time
— More sanity checks added to MeshImporter
- Performance tweak: faster animated bounding box calculations
- Don’t pass input to application if it got processed by CEGUI (helped in removing editor/console visibility check hack)

518 Diff Diff IonutCava picture IonutCava Sun 04 Oct, 2015 20:08:56 +0000

[IonutCava]
- New asset loading system and new asset formats (DVDGeom – geometry and material data. DVDAnim – animation data):
— Separate ASSIMP importing process (including animations) from Mesh/SubMesh/Material creation:
— Interface ASSIMP with the rest of the framework via a “ImportData” structure.
— Allow saving/loading from file of the entire ImportData and animation data entries via serialization.
— Allow serialization of VertexBuffers and update animation system’s serialization structure as well
— Base all serialization/deserialization processes on the ByteBuffer class with support for loading/saving to files
— If DVDGeom and DVDAnim files are not found, fall back to ASSIMP to load the data and save them for later use
-— Loading times reduce in half if data is already present.
-— Multi-threaded asset loading is now possible.
-— Other (non-ASSIMP) importing libraries can now be used.
-— DVDGeom and DVDAnim files can be shared/moved but not edited (they hold binary data for smaller memory usage)
- OpenGL/Direct3D usage is a compile time toggle (for now) for performance reasons.

460 Diff Diff IonutCava picture IonutCava Tue 02 Jun, 2015 22:11:41 +0000

[Ionut]
- Linux port work

350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

331 IonutCava picture IonutCava Sat 06 Dec, 2014 20:53:45 +0000

[Ionut]
- Limited line length to 132 characters to improve readability and diff-comparisons
- Refactored memory allocation/deallocation functions
- Fixed a few compatibility issues with HashMap.h
- Fixed a bug in GPU Skinning shaders (cast a float to int)