Giter Site home page Giter Site logo

mundus's Introduction

Mundus Java CI workflow

Mundus is a platform independent 3D world editor, built with Java, Kotlin and LibGDX + VisUI. You can create your scenes in Mundus and then use the Mundus runtime to render and interact with those scenes in a libGDX project. See runtime usage for an example. You can see current milestones for releases on the milestones page.

Screenshot

This project is at a very early stage in development and APIs may be missing basic features. Create an issue if you notice something important that is missing.

Current features

Below are some of the more interesting features, that already work

  • Creation of multiple terrains
  • Height map loader for terrains
  • Procedural terrain generation
  • Texture splatting for the terrain texture (max 5 textures per terrain)
  • A complete terrain editing system with texture & height brushes
  • 4 different brushes (brush form can be an arbitrary image, like in Blender or Gimp)
  • 3 brush modes for each brush: Raise/Lower, Flatten & texture paint
  • Custom implementation of gdx-gltf PBR shader for model rendering
  • Water quads with reflections, refractions, foam, and customizable ripples
  • Static Skyboxes with support for multiple skyboxes
  • Loading of g3db/gltf/glb files. GLTF is the recommended format.
  • Loading of obj/fbx/dae files (note, that the fbx-conv binary must be set in the settings)
  • Visual translation, rotation tool, and scaling tools
  • Multiple scenes in one project
  • Full screen preview mode
  • A component based scene graph (not fully implemented yet)
  • Basic export of the project into a json format + asset (not needed for libGDX runtime)
  • Undo/Redo system for most operations
  • Highly accurate game object picking system, based on id color coding & offscreen framebuffer rendering. Basic concept: http://www.opengl-tutorial.org/miscellaneous/clicking-on-objects/picking-with-an-opengl-hack/

Latest Release Video

Release video

Discord Channel

If you need help with Mundus you can check out the Mundus discord here or alternatively in the libGDX discord go to libraries/Mundus thread under the SPECIFIC TOPICS section.

Things to consider

  • Mundus is constantly changing. Especially the internal representation of save files. At this stage of the project backwards compatability is kept between minor changes, and I keep backwards compatability in mind for major version changes, but it is not guaranteed as the APIs are still being developed.
  • Depending on your keyboard layout some key shortcuts might be twisted (especially CTRL+Z and CTRL+Y for QWERTZ and QWERTY layouts) because of the default GLFW keycode mapping. You can change the layout mapping in the settings dialog under Window -> Settings.

Runtime

The only runtime being developed is for libGDX, which is included in this repository. See runtime usage for an example. Runtimes for other engines/frameworks are not planned in the near futures.

Made with Mundus

Listed from newest to oldest:

Created by: AntzGames

gif


Created by: JamesTKhan santa

Created by: AntzGames image


Created by: AntzGames image


Created by: JamesTKhan image

Contributing

Contributions are greatly appreciated. To make the process as easy as possible please follow the Contribution Guide. To get an overview over the project you might also want to check out the Project overview & architecture article. I label issues that are good for first time contributes as "good first issue."

Working from source

See this wiki article.

Mundus origin

This started as a fork of Mundus. Mundus is no longer developed so this standalone repository was created. Special thanks to mbrlabs and the original contributors of Mundus for all the work they did.

Mundus was licensed under the Apache-2.0 license.

Credits

Logo design: Franziska Böhm / noxmoon.de (CC-BY-SA 4.0)

mundus's People

Contributors

antzgames avatar attilabo avatar codenigma avatar dgzt avatar freyinds avatar jake-goldsmith avatar jamestkhan avatar krukhlis avatar mbrlabs avatar nox-moon avatar sayyidhussain avatar schreiberdev avatar yuripourre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mundus's Issues

Orthographic camera support in scene

Is your feature request related to a problem? Please describe.
The scene only support perspective camera.

Describe the solution you'd like
Orthographic camera support in scene.

Terrain issues when given negative height value

There seems to be an issue with terrains when they are given negative height. Paint brushes do not paint in the correct area and the terrain almost becomes unpaintable.

Steps to replicate

  1. Set terrain to -100 on Y axis.
  2. Try to paint on terrain and it will not paint properly
  3. Set terrain back to 0 height. It does not update.....
  4. Select something else in outline then select terrain again. Now you can paint again

Point Lights

Would like to include Point Lights in the future as a GameObject which can be moved around the scene.

Snowing

Describe the solution you'd like
I think the snowing feature would be useful.

ability to add meta data to GameObjects

Is your feature request related to a problem? Please describe.
As a game developer I want Mundus editor to add a new Meta Data Component type for GameObjects so that I can store physics parameters or any other meta data parameters to be used in the runtime.

Describe the solution you'd like
I know long term plans are to integrate a physics engine in Mundus. Also there are many physics engines available. Initially having a simple Meta Data Component type available to GameObjects that will allow you to store one JSON entry and make it available in the runtime.

This Meta Data Component type can be useful not just for storing physics parameters but ANY parameters. Hopefully it will be reusable/useful when and if Mundus is integrated with a physics library.

Additional context

So I was thinking in the editor, if you select Add Component you currently get a panel asking what type of component you want to add. The drop down will allow a new component type META Data Component. This component has one data field in which you can store any String (i.e. JSON Text or XML or YAML).

image

This solution has no strong coupling with any physics engine. This solution is simple in my opinion. This feature will allow us to store any custom meta data for each GameObject.

Thoughts? Opinions? Concerns?

Look into deprecation of currentSelection and terrains variables

Original authors of Mundus marked the following variables in Scene.java as deprecated

    @Deprecated // TODO not here
    public Array<TerrainAsset> terrains;
    @Deprecated // TODO not here
    public GameObject currentSelection;

The likely reason for deprecation is that currentSelection is only used in the editor module, so it does not belong in Scene.java from the commons module as it serves no purpose outside of the editor. The variable should be moved out of commons and somewhere in the editor module which will result in a large refactor.

Create asssets.txt file in the editor module

Currently to use runtime a custom gradle task must be added to projects to generate an assets.txt file which AssetManager uses to read in all the projects assets during runtime. This is due to limitations on getting a list of all files in a directory.

A better approach for the client side would be to generate the assets.txt file in the editor code instead, to make using the run time easier.

Clean up assets utility

Is your feature request related to a problem? Please describe.
It is easy to end up with lots of unused asset files in Mundus. Deleting assets one at a a time is slow.
Adding a utility that auto-cleans up unused assets would be convenient. We already have the usages interface in place so this should be doable.

Add UI for Ambient and Directional Light

Currently when creating a Scene the directional light and ambient light intensity and direction are hard coded (see Scene.java construtor). As far as I can tell these values cannot be adjusted in the UI, only in the runtime. I suggest adding UI settings to change ambient and directional light settings which save with the scene.

In EnvironmentMenu it looks like work was started on ambient light UI but its not enabled

Correct duplication of GameObjects

When you duplicate a GameObject in the editor, each component is cloned in GameObject.java

        this.components = new Array<Component>();
        for (Component c : gameObject.components) {
            this.components.add(c.clone(this));
        }

However, some components do not have cloning implemented due to technical limitations or just not being implemented yet, like terrain component

    @Override
    public Component clone(GameObject go) {
        // Cant be cloned right now
        return null;
    }

When duplicating a GameObject with components that cannot be cloned the editor crashes as a null component gets created and a NPE happens. We should add logic to handle when a null component is returned, either stop cloning the game object, or clone it partially without the components that could not be cloned. Adding a UI dialog in the editor would be a nice addition as well to notify when this happens.

Replace ModelShader with PBR Shader from gdx-gltf

The current ModelShader is rather limited and does not support animations. Replace the current model shader with PBR shader form gdx-gltf.

Also, when importing GLTF models, the textures get copied to the project folder via GLTFLoader but the project does not load/import them in, so they have to be manually loaded in via UI after model import. Having textures import automatically would be ideal.

Multi-select textures for import

Is your feature request related to a problem? Please describe.
Currently textures can only be manually imported one at a time, it is slow and cumbersome.

Describe the solution you'd like
VisUI FileChooser supports multi-selecting files. Being able to select and import multiple textures would be convenient.

Temp folder for model imports is never cleared out

On model import, model files and dependencies are moved into the .mundus temp directory in users folder. I am not sure why the temp directory was needed as I did not write that part of the code (located in importToTempFolder method, ModelImporter.kt).

One way or another the cache should be cleared at some point. First we need to determine why the temp folder is needed or if we can bypass that entirely.

Auto-Texture Terrain Layer feature

Is your feature request related to a problem? Please describe.
Hand painting terrains can be cumbersome.

Describe the solution you'd like
A feature that auto-textures the terrain by utilizing several height/slope layers would be nice to have.

Additional context
I have done something similar for a previous tutorial video : https://www.youtube.com/watch?v=irbOA-hpJkI

Saves new water component if I exit withtout saving

If I add new water component to the project and exit without saving the application saves the new water component.

I've tried that delete water component and exit without save and if open the application the water component is still there, so the delete function is working correctly.

I've checked the source code and I've seen there is saving when I add new terrain.

Should we save the project if we add new water or terrain component to the project?

Scene deleting

Is your feature request related to a problem? Please describe.
We can create new scene, but we can not delete an unused scene, only manually.

Describe the solution you'd like
A scene deleting button.

Loading assets per scene instead of all assets

Is your feature request related to a problem? Please describe.
Currently Mundus loads all assets on both the Editor and Runtime when loading a project. This is fine for small projects, and even makes scene switching fast, but becomes less practical in large projects with lots of assets.

Describe the solution you'd like
Look into refactoring asset loading to only load what is needed for the current scene to see if its viable.

Additional context
This could be a pretty sizable refactor of the loading system and is not a high priority.

Improve SimpleNode efficiency

Is your feature request related to a problem? Please describe.
SimpleNode does not cache the matrix transforms. A call to getTransform recalculates the transform along the entire parent chain every time which is inefficient on the CPU.

Describe the solution you'd like
Implement caching of transforms with an isDirty flag, as described here https://gameprogrammingpatterns.com/dirty-flag.html

Investigate turning Terrain shader into an uber shader

Is your feature request related to a problem? Please describe.
The terrain shader is not an uber shader currently. That means the shader contains multiple branching. If a terrain is not using normal maps, the shader still contains branching for it. As terrains get more features, this will become even worse unless an ubershader is implemented.

Describe the solution you'd like
If practical, convert the Terrain shader to an uber shader that recompiles on the fly as needed to accomodate the terrain it is used for so that the custom built shader only contains logic needed for the individual terrain.

Fog is not applied to water

Fog effects are not currently applied to water. This is apparent when moving far out from the scene, everything else becomes white but water does not. Water shader will need updating to calculate fog

image

Handling Application start when previous opened project was deleted. Project Selection dialogue?

When opening the application it attempts to load the previously loaded project in Editor.kt create()

// open last edited project or create default project
var context: ProjectContext? = projectManager.loadLastProject()
if (context == null) {
    context = createDefaultProject()
}

if(context == null) {
    throw GdxRuntimeException("Couldn't open a project")
}

However if the previously opened project was deleted (or the .pro was corrupted) then the fallback is to create a default project only if the registry is empty or last project is null

private fun createDefaultProject(): ProjectContext? {
    if (registry.lastOpenedProject == null || registry.projects.size == 0) {
        val name = "Default Project"
        var path = FileUtils.getUserDirectoryPath()
        path = FilenameUtils.concat(path, "MundusProjects")

        return projectManager.createProject(name, path)
    }

    return null
}

If the fallback occurs and the registry is not empty, a GdxRuntimeException is thrown. The solution may be to have a separate "Project Select" dialog in this situation to choose a project to open or create a new one. It would also be nice to have this dialogue for first time launching the application as well, instead of creating a default project.

Save last open directory

At a per project level, it would be convenient to save the last opened directory from a file chooser. This could be saved in the project Registry which would persist on project close.

Than, when a file chooser is open, it defaults to the last directory viewed on that project.

Water/Terrain assets are not reusable/able to be placed again

Is your feature request related to a problem? Please describe.
Model assets can be placed multiple times. For terrain and water assets, once they are removed from the scenegraph they become useless. They cannot be re-added to the scenegraph once removed.

Describe the solution you'd like
The ideal solution is to have placement tools for terrain and water as well.

Ability to duplicate materials

Is your feature request related to a problem? Please describe.
If you are reusing the same model but want to use different materials, you have to create a new material manually and then assign it, and assign all the same attributes that you want to keep the same. This is cumbersome.

Describe the solution you'd like
The ability to duplicate materials would save alot of time and hassle so that materials can be duplicated and then only change what you need changed while keeping everything else the same.

Selecion still visible after deleted model

Describe the bug
If I select a model from Outline section and delete it then the selection still visible.

To Reproduce
Steps to reproduce the behavior:

  1. Select a model from Outline section
  2. Right click onto selected model
  3. Click to Delete button
  4. The model deleted but the selection still visible

Video

example.mp4

Editor crashes on tool selection on project opening

When first opening a project, before selecting any game objects, if you select any of the transform tools the application crashes with an NPE due to the tools trying to access currentSelection variable which is null as no object was selected yet.

example code:
Vector3 pos = projectContext.currScene.currentSelection.getPosition(temp0);

image

[12:20][Fatal][Log] java.lang.NullPointerException
	at com.mbrlabs.mundus.editor.tools.RotateTool.scaleHandles(RotateTool.java:283)
	at com.mbrlabs.mundus.editor.tools.RotateTool.gameObjectSelected(RotateTool.java:252)
	at com.mbrlabs.mundus.editor.tools.ToolManager.activateTool(ToolManager.java:82)
	at com.mbrlabs.mundus.editor.ui.modules.MundusToolbar$9.clicked(MundusToolbar.kt:197)

Water Reflections break on Camera Yaw/Roll rotation

Describe the bug
Water reflections break when the camera view is rotated on X or Z axis. Reflections only invert the pitch currently.

To Reproduce
Steps to reproduce the behavior:

  1. Load into a runtime project with water
  2. Rotate camera (cam.rotate(Vector3.Z, 50);)

Setup gdx-runtime for a package repository

Currently if we want to use the gdx-runtime then we should put the compiled jar into the project instead of to use a package repository. I think this is a bit uncomfortable.

So I think before the next release we should setup the gdx-runime that someone could use it via package repository, e.g. JitPack.

Skybox issues

Skybox needs some looking over, overhauling. Not the shaders, just the functionality of updating the textures, persisting those textures and getting them rendering in the runtime (right now, they do not). When I tried to use the skybox UI to change the skybox textures, the code seems to wipe out the changes somewhere along the lines and the new textures do not get accepted or rendered. Looks like the feature was never fully finished but its close, as the UI is already built out.

Ability to disable water reflections/refractions

Is your feature request related to a problem? Please describe.
Currently reflection and refraction textures on water are expensive because they require additional render passes. Being able to disable these features would be ideal for lower end hardware/GWT. An ubershader would accommodate these changes best so we should look into refactoring the current water shader to be a uber shader.

GameObject finder/picker method in gdx-runtime module

Is your feature request related to a problem? Please describe.
I think a game object finder/picker method by screen x and y coordinates in the gdx-runtime module would be useful.

Describe the solution you'd like
A GameObject findBy(int screenX, int screenY) method in SceneGraph class.

Additional context
The editor uses a finder method in GameObjectPicker class but it uses opengl hack what is not really recommended ( http://www.opengl-tutorial.org/miscellaneous/clicking-on-objects/picking-with-an-opengl-hack/ ).

An other way that use libgdx's Intersector.intersectRayTriangle(...) method to check for every model's meshes.
(Examples: libgdx/libgdx#1256 , https://stackoverflow.com/questions/56837626/libgdx-intersect-ray-with-mesh-from-modelinstance ). But I think it is cause huge CPU usage if there are lot of game objects on the map.

Models with multiple materials have inconsistent mouse picking

Describe the bug
For models that have multiple materials, they can only be mouse picked by clicking the on the first material somewhere visible on the model.

Issue likely revolves around the PickerColorEncoder logic in PickableModelComponent which appears to use the first material only.

To Reproduce
Steps to reproduce the behavior:

  1. Have a model with multiple materials
  2. Try selecting it in the 3d view by clicking various areas of the model

Runtime not setting transformations

Transformations of GameObjects is not loaded on the runtime project, so all GameObjects appear at 0,0,0 when using the runtime. Looks like the runtime libraries scene converter is missing the logic that initialized objects and components as seen in the editors scene converter.

Add draw calls count statistics to editor

Would like to have a draw count display in the editor, maybe in the bottom right near the FPS counter to allow for easier performance monitoring. We should be able to use the GL Profiler and capture draw counts when rendering the scene.

Investigate Toaster class

There is a Toaster class in Mundus from the original authors which according to comments displays android like toast messages like when a project is saved in the UI class there is this line

UI.toaster.success("Project saved")

This does not appear to be working though, but it would be nice to have as currently actions like saving provide no visual feedback. We should look into this class to see if it can be made to work.

Fix Gimbal Lock on Editor Camera

Describe the bug
When looking directly up or down the camera spasms due to Gimbal Lock.

To Reproduce
Steps to reproduce the behavior:

  1. Look directly up or down in editor view.

Consider using separate thread for loading asset/project

When a larger project is loading all you see is a black screen until it has finished loading. Consider loading on a separate thread and displaying a loading message when opening a project. I suspect the main culprit is asset loading for the delay.

Reorder objects in Outline Pane

Is your feature request related to a problem? Please describe.
Objects in the outline pane / scenegraph cannot be repositioned.

Describe the solution you'd like
The ability to move objects in the outline pane up/down/top/bottom

Error during import model what's name contains space

Describe the bug
Mundus editor don't find the texture if it's name contains space.

To Reproduce
Steps to reproduce the behavior:

  1. Create a texture for a model in Blender what's name contains space.
  2. Go to Mundus editor
  3. Click on 'Import/Import 3D model' button
  4. Select the model
  5. Click to 'IMPORT' button.
  6. See error

Screenshots
blender
mundus_editor

Low Priority: Assets section at bottom: Organize assets by type? Show Hierarchy?

Not high priority but once you fill up your scene, you will have a lot of 'stuff' in the ASSETS section at the bottom.

It would be great to have them organized. Having models isolated would help me personally.

One suggestion is to organize by type:
[MODEL],
[TEXTURE],
[MATERIAL]

Another option, but harder to implement, is to organize by parent/child hierarchy:

[MODEL]

[TEXTURE1]
[TEXTURE2]

[SKY]

[TEXTUREfront]
[TEXTUREback]
[TEXTUREtop]
[TEXTUREleft]
[TEXTUREbottom]
[TEXTUREright]

New scene method creates file(s) but doesn't save project

Describe the bug
If we create a new scene then the application creates scene file(s) in the project directory but doesn't save the project. And if we close the Mundus editor without project saving and reopen it then the new scene is missing but it's file is still in project directory.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Scenes' / Add scene" button
  2. Add new scene
  3. Close Mundus editor without project saving
  4. Open Mundus editor
  5. Click on "Scenes" menu
  6. The new scene is missing

Rain

Describe the solution you'd like
I think the rain feature would be useful.

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.