Coder Social home page Coder Social logo

pulsar's People

Contributors

julien-pires avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

pulsar's Issues

Modify namespaces architecture

Namespaces should look like this:

  • Pulsar
    • Asset (Asset management)
      • Material
      • Mesh
      • Shader
    • Graphics (Graphic engine)
      • Rendering (Rendering engine)
        • RenderPass
      • Graph (Scene graph engine)
    • Core (Core function)
    • Math
    • Component (Component system)
    • Game (Game specific function)

Remove owner parameter in GameObject constructor

The constructor of GameObject class take a parameter of type GameObjectManager called owner. It defines the object manager in which the game object is contained.

This parameter should be removed. Instead, the Owner property is filled by the GameObjectManager when a game object is added.

Add ability to lock asset

Asset can be modified by anyone. In some case it will be useful to lock an asset from modifications to avoid undesirable modifications. Locking an asset prevents asset properties to be modified by developers but it's still possible to get the value. Assets manually created aren't locked so developers has a full access on what they create.

For example, a mesh loaded from a file should not be modified and the material associated too.

Add ability to add SubMesh to a Mesh

Currently a Mesh can have sub-meshes only if we load it through a file or a prefab factory. Creating an empty mesh is useless since we can't add sub-meshes.

Mesh should have a method to add sub-meshes in it. Developer provides some data composing the sub-mesh (rendering info, bounds, ...).

Generate sub mesh ID by RenderingInfo class

The ID of SubMesh class is generated by SubMesh or Mesh class themselves. It will be better to generate this ID only by RenderingInfo class. SubMesh just has to return ID of RenderingInfo instance.

Instancing use the ID of SubMesh to create different instancing (one per sub mesh). So this ID has to be unique.

Add a specialized remove node function

A node has a RemoveNode function to remove a child node. This is basic task of a RemoveNode function. But some node are specialized node such as scene node. In this case removing a child node implies more than removing it in the child list.

By creating a RemoveNodeIntern function, a specialized node can provide a specific functionality when a child is removed. For example with the scene node, the child is removed from the child list and the RemoveNodeIntern removes also the child in the scene graph.

RemoveNode function still exists and is responsible for calling RemoveNodeIntern.

Remove BaseEffect

BaseEffect class is no longer needed with the new way shader work in the engine.

Reuse vertices in MeshBoundingBox

Each time MeshBoundingBox is updated with a new BoundingBox, vertex buffer is filled with new vertices. Instead of create new verticeswe can use them and just update the Position property.

Add ability to lock material

Material properties can be modified by anyone. Adding the ability to lock a material can be useful to avoid unintended modifications.

For example, sub-meshes have a material property and some sub-mesh are loaded from file. We would like that material to be not modifiable because the sub-meshes can be used at many places in the game. In this case if the developer wants a different material, he has to create new one which will not be locked because created by himself and not by the asset manager.

Hide mesh buffers

Mesh vertex buffer and index buffer are public. This should be internal to limit acces to class inside Pulsar namespace.

Create a default vertex buffer for empty mesh

A mesh shares his vertex buffer with all his sub-meshes. In order to do this with customized mesh, empty mesh has to provide a vertex buffer. Developers have to use this buffer to create sub mesh rendering info. A check is performed when an attempt to add a sub-mesh in the mesh instance is done.

Create methods to modify RenderingInfo of a SubMesh

RenderingInfo is (or will be) an internal class. Now SubMesh has to provide a method to modify some data such as:

  • Primitive type
  • Start index
  • Vertex offset (in index notation, not byte to make it easier)
  • Vertex count

Others data will be compute from these values.

Remove directly ComponentHandler

ComponentHandlerSystem do a search before removing a ComponentHandler. This search is useless, remove function will return false if the ComponentHandler doesn't exist.

Boundig box doesn't fit entire mesh

When a transformation, particularly rotation, is applied to a mesh, associated axis aligned bounding box doesn't fit the entire mesh. The method used to compute the aabb seems incomplete.

Assign one or more Component type to a ComponentHandler

When a component is added to a GameObject, the ComponentHandlerSystem get notified by the GameObjectManager. The CHS dispatch the new component to every ComponentHandler.

One improvement would be to assign one or more Component type to a CH and dispatch the component only to interested CH. CH can expose a property which is an array of Type class corresponding to a type of Component or class derived of Component. A null value for this property can be interpreted as "Send me all Component".

Add a game object manager

A game object manager is responsible to keep track of all game objects and events related to them (added, removed, ...).

Rename Texture class

Texture class name collide with the xna Texture class. Renaming will resolve this issue.

Make material solid OR transparent

Material has a IsSolid and a IsTransparent properties. This means that if we assigned true to both properties, the material is "solid-transparent" at the same time.

It will be better to only have an IsSolid or an IsTransparent properties but not the two. With one we can have a solid or transparent material. Having only one allow the scene graph engine to sort correctly the material in the render queue.

Add a component handler

For each component type there is a component handler responsible for managing and updating them. A component handler define the behavior of a component.

All components handler have to be managed by a unique manager. In most common case there will be only one instance of a component manager in a scene (but having more is possible).

Make RenderingInfo class internal

RenderingInfo instances are only used by the renderer system. Let it public isn't usefull. Instead we had to provide methods to modify information on it. Making it internal will hide buffers from outside.

Create a shared library for the engine and the pipeline

The solution is composed of multiple project. One for the engine, one for the extension pipeline and one for the demo. The extension pipeline library uses some class found inside the engine library. This means the pipeline references the engine.

A better solution will be to create a third library containing classes shared used by the engine and the pipeline. This will make the engine and pipeline more independent from each others.

Remove out modifers

Out modifiers isn't compatible with C# version of Xbox 360. Interfaces using out have to be refactored to work as far as possible like if they have the modifier.

These namespaces contain interfaces with out modifiers:

  • Asset

Use Dictionary to store instance group by ID

GeometryBatchManager class stores a List of GeometryBatch in a Dictionary by renderqueue ID. This list must be replaced by a Dictionary storing GeometryBatch by batch ID for fast search.

Rename GeometryBatch class

Rename GeometryBatch and GeometryBatchManager class with a name containing instancing or instance words.

Change IsVisible property name in IMovable

IMovable interface has a Visible property and an IsVisible property. These two names are relatively close and this can be confusing.

IsVisible property name need to be changed.

Remove default parameters in function calls

Some part of code use C# default parameters in function calls. This is incompatible with Xbox 360 C# version. These default parameters have to:

  • be simply removed and it's up to the developer to assign each parameters when he uses the function
  • be replaced by different version of the function each one having more and more parameters to match the equivalent one with default parameters

Improve asset management

Currently the asset system use one ContentManager for all assets. This reduce the level of granularity in ressource management. Assets are load and keep in memory during the entire lifecycle of the application.

The asset management can be improved by providing a ContentManager for each asset storage. An asset storage can be used per scene. In rare case a scene needs more than one asset storage (except system asset storage). With that, there is one ContentManager per scene and unloading a scene will unload assets.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.