multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 424 forks source link

Ogre3d #1347

Closed CrosRoad95 closed 4 years ago

CrosRoad95 commented 4 years ago

Well, i created minimal example of working ogre in mta, here's result ( debug build ) https://www.youtube.com/watch?v=S0hXvpUcRN0

general idea:

make it in CEF style, but restrict to single instance, user could create it and manipulate with functions. it creates regular texture which can be draw with any current dxDraw function, example at full screen.

adventages

Ogre is still supported, has huge base of users, games based on ogre you can download at steam ( look at ogre website ). its stable, supports everything people want: lights, shadows, infinity draw distance, multiple cameras, multiple views. many variants of shaders. it uses directx11 saml1er want to add. has a lot of cool plugins like: particles, procedural meshes, material editor http://wiki.ogre3d.org/Ogre+Procedural+Geometry+Library http://wiki.ogre3d.org/HLMS+Editor

it is multithreaded, so if you load models/textures/shader it will not cause lag spike at all.

overall information:

even if it is minimal example, branch is massive https://github.com/multitheftauto/mtasa-blue/compare/master...CrosRoad95:ogre?expand=1 image it introduces 8 new projects:

  1. ogre - main ogre project
  2. Ogre Core - interface between mta and ogre, decrease amount of new headers in main mta projects.
  3. Ogre test - for standalone quick tests without needed to start mta
  4. STBICodec - support for textures in formats jpeg,jpg,png,bmp,psd,tga,gif,pic,ppm,pgm,hdr + default DDS
  5. RenderSystem_Direct3D11 - directx11 render system
  6. ogreRTShaderSystem - runtime shaders compiler
  7. ogrePluginParticleFX - particles
  8. ogrePluginAssimp - to make possible load model in any format, generate ogre .mesh and .material file in fly

project will not compile for you, i set for now fixed pathes in some files.

my questions:

  1. is it worth?
  2. it will introduce many new elements, but ogre already has own name system, make elements anyway or make functions like createLight returns string ( identifier eg "light_id" ) ?
  3. how to name all functions? example "setCameraMatrix" is already occupied and ogre has own camera/cameras. same with lights, objects, rendering settings like near camera clip ect.
  4. what should be availiable in initial release?
  5. this update can introduce hundreds of new functions, should i pack them into single "set/getXXXProperty", or not?

other

example how looks shaders/materials, you can put multiple in single file image

i'm waiting for feedback

qaisjp commented 4 years ago
  1. Is it worth?

    This would be the equivalent of embedding Unreal Engine inside Unity - the real solution is to just use Unreal Engine.

    I really respect the amount of work you've put into this so far, but I don't see any obvious benefit in embedding another game engine into MTA. Please correct me if I am wrong.

CrosRoad95 commented 4 years ago

embedding latest version of unreal engine inside 16 years old unity - worth. And this is not game engine, it just render graphics. it took me under 2 weeks to make it, while saml1er spent half a year to make custom animations and he spent a lot of time by fixing issue with "setTexture" while i don't have to face with such things.

instead of adding another layer, duplicated functions, i could make function to switch between old renderware, and ogre and get effect like that https://www.youtube.com/watch?v=kTedftJc96U

Einheit-101 commented 4 years ago

getCameraMatrix = OGREgetCameraMatrix (or something like that)

This would be the equivalent of embedding Unreal Engine inside Unity - the real solution is to just use Unreal Engine.

Technically you are correct but practically this is an elegant solution to many issues we are facing, the possibilities are endless (new effects, infinite render distance, new shaders). I am trying to make my server looks as good as possible but the performance of MTA is currently beyond abysmal, even a very simple map and very simple shaders can cause absurd CPU load and it is just not fun at all to play with 40 fps while using an i7 6700. My goal for my next server is stable 60 fps, i dont know yet how to achieve this with the things that i planned. Outsourcing effects and some other stuff to a more performance-friendly and better-looking OGRE variant seems like a start.

CrosRoad95 commented 4 years ago

Ogre prefix before functions will looks ugly, i'm looking for better names

Vadya963 commented 4 years ago

getCameraMatrixOgre the word "ogre" should be inserted in any case, one question, where?

CrosRoad95 commented 4 years ago

or just put all of these functions into some namespace? ogre.functionName eg ogre.getCameraPosition. qaisjp help

qaisjp commented 4 years ago

If we did this (which I think we should not, and which I am confident we won't merge), yes, I think it should namespaced underneath an ogre module.