ogrender... blogre...something

After reading some fuss about the death of bge, I wondered how hard could it be to replace it with a different engine, still embedded in that wonderful thing that is blender.
I picked up Panda3D but that didn’t go very well (some library thing in ExecutionEnvironment that I still don’t understand).
Anyways, test number 2 was on Ogre3d. The integration turned out to be far easier than expected.

https://youtu.be/jOBaKz-E5QA

Of course it’s just a proof of concept, it starts the engine, embeds the renderer and loads a predefined mesh but it works.
The point is that once the renderer is in place, the “only” thing that remains to do is to translate the blender scene into ogre things, which is tedious but not very hard.
In all that, and this comes from someone that firmly believes no human being should ever come close to use C or C++, the hardest things to code where CMake instructions (I think the C in CMake stands for “curse”).
Clearly I’m not saying that the developers of blender should stop doing what they’re doing and jump right on to integrate ogre - it’s still a lot of work to do it in a sensible way, for all the platforms where blender runs - but if I can do it then there are thousands of people way smarter than me than can do it faster and better.
And blogre would be amazing, there, I’ve said it.
Anyways, I’ll try to go a bit further and see if I can slap in some scenegraph parsing and maybe a jvm to run scripts.

If someone else wants to try, it’s really just a matter of downloading ogre (i’ve used the latest available in the repositories), adding a submodule to blender, creating a VIEW3D_OT operator in view3d_view.c (almost identical to the one for bge) and find the system handle for the blender window (I’ve used the X11 libraries but I think it should be possible to read it from the GHOST system of blender, I just gave up because I’m too lazy).

Keep in mind that Ogre3d is a rendering engine, not a game engine.

So, in order to actually provide any significant value, you would have to either:

A) Integrate Ogre into the existing internal engine (BGE), as a renderer.

Or

B) Build a new engine around Ogre as a renderer, and integrate that into Blender.

Neither would be particularly easy.

Of course I know it’s a rendering engine, but that is also the only “interesting” part of a game engine.
A) would be painful, at least from my perspective, I hate to sit down and start digging into code to find out how things are linked together, find a way to break that link if it exist and replace it. Ghastly.
B) is effortless, save for the time needed to implement the design of choice.
The troubles I see come all from the multiplatform nature of blender, I can barely compile it on my system, even setting up CMake targets and variables to allow the project to be built on different platforms would be way ahead of my skills.

I would look into blenders render, look for anything that is … crappy,

fix that, by using other libraries, or writing something, test… reiterate until you can get some nice boosts without breaking anything,

and then ask for help building for other systems?

Just to be clear, I’m perfectly fine with BGE as it is. The only problem I have with it is that it is not capable of take my awful models and horrible textures and automagically turn them into state of the art assets. Unfortunately there is no game engine out there that can help with that.
I do think that, in an imaginary future, “outsourcing” the rendering task - as it is already done for the audio system for example - would be an advantage, because it is one less thing to maintain.
The test I made was to check out how hard linking the two worlds could be.
The test also gave me an answer to the hypothetical question “what if they threw bge out of the window”: I would happily replace it with a new engine, also integrated in blender (that’s the beauty of bge), based on ogre.

The only problem I have with it is that it is not capable of take my awful models and horrible textures and automagically turn them into state of the art assets

(try not to be rude, and it’s best to label whom you are responding to)

I think we all understand that capacity to make art, and push the limits of detail vs polycounts,

at present, however there are some serious issues with game engine vs frames_per_second

some of these might be something you could gleam, and repair,

this is all I intended on conveying.

Not in my experience, but if you think it’s so easy, you should just get it done.

It shouldn’t take you more than a few weeks, right?

BluePrintRandom, rude? Me? I’m a fluffy bunny wrapped in a candy swimming in a pool of honey. If I have been rude that was entirely due to my poor knowledge of the language, I sincerely apologize.
I try not to quote because I found the resulting answer less readable.
For the model-texture part, was that the rude part? I mean, it is my personal experience and a description of my artistic skills that I used to explain why bge is fine for. It wasn’t meant to be a general statement - even though I think that sometimes people tend to forget that computers are not capable of improvements, they (for now) just execute stuff.

It’s cool, I was interpreting it as a response to me, then I realized it was not,

I am still learning modeling and am defensive :stuck_out_tongue:

Goran, you must look at things from the perspective of my ego, which is scientifically known to be driving force behind the expansion of the visible universe.
So my answer is yes, it would take me a few weeks. That’s because I have more or less zero practical knowledge of C++, otherwise I would say a few days.
I’m not sure if I want to try. I seriously dislike developing in C/C++. I had to force myself into this experiment.

I would suggest, if you honestly wish to pursue this, on using the GameKit engine as a foundation. It already has conversions for most game-centric Blender objects built-in, can handle some of the BGE logic stuff already, and already has some examples you can use.

@Blueprint:
It is painfully clear that your only knowledge about the bge codebase is what you have ‘picked up’ from people on the forum mentioning that it is hard to maintain/extend. Please refrain from joining conversations where you have neither questions nor answers.

@pgi:
I would be interested for a direct comparison of the rendering engines. Ie for a given polycount/lampcount, which is faster?
Also, which is more capable? Does ogre have any way to understand blenders material shaders? I guess not?

It may be time for me to brush up on my lower level languages and take a look at the bge from the other side.

If we’re going in the way of replacing the bge with an existing game engine, then it’s better to save the effort for Panda3D integration. It’s a full game engine, not just a render engine like ogre, and all it needs is an editor, which would be blender in this case. It’s 1 of the most (if not the most) underrated game engine, this opinion is after a few months of its usage. It’s more “compatible” with blender as it can compile existing glsl node materials and uses python which is an advantage for existing bge users.
Also it’s source code is really organised and human readable to a certain extent, unlike blender generally.

BTolputt, at the present time I have no plan to do more than little experiments around the idea (I do not consider bge dead or anything close to die).

sdfgeoff, I think I can say that ogre is completely unaware of anything related to blender’s representation of things, including material shaders. It has access to the data in the same way ketsji does so it should be a matter of translation routines. If you want to dig, the embedded engine life path is:

…/release/scripts/startup/bl_ui/properties_game.py[RENDER_PT_embbeded::draw] …/source/blender/editors/space_view3d/view3d_view.c::game_engine_exec
…/source/blender/gameengine/BlenderRoutines/BL_KetsjiEmbedStart::StartKetsjiShell

where a plain loop takes place until the game ends.

Jackii, I looked into Panda3d at first, I have been unable to make it cope with blender because of some dynamic library lookup. I tracked down the problem to something that the ExecutionEnvironment class of Panda is doing then I simply gave up. I think that someone more patient than me could get it done.

Retracted

The render, that exists and is deeply embeded in current bge, if someone were trying to replace,
It would he a good time to look at what exactly is broken about it in the first place.

My 2cents.

@blue, I liked the first answer much more :D.

By the way, if anyone happens to read the thread and wishes to say something, know that I deem the knowledge of the actual blender code totally irrelevant and I would gladly accept any observation on the matter of an hypothetical external engine embedding.

And the bge code actually looks like random garbage. I’m just looking at a single function made of 1040 lines, by the time you reach line 200 you already forgot your own name. It’s also filled with unfathomable names, commented out sections, various sorts of stylistic conventions, meaningless comments.
It is not untypical for projects of appreciable size to become like that, entropy and evolution apply to software too.
Although the outer framework is not bad at all, it has a kind of aesthetic beauty.

It might be worth discussing how one would start cleaning up the code, maybe in a separate thread. I would definitely go for breaking up those humongous functions.

So, I downloaded and installed MS-Vstudio- and git and CMake, however I accidently set my git to C:/

and I can’t seem to change it,

I am not sure how bad it is , but did not want to accidently build over anything important,

how do you change your git dev folder? (lol)

this has prevented me from even looking at the source,

edit - looks like in bash - “Git init C:\BlenderDEV” fixed it but I am not sure,

edit - pulling down blender now :smiley:

I think I am ready to pull down the source now,

The only thing you can mess up is your local copy of the project, you need write access to the repository to actually do something bad for other people. I suppose git for windows is the same as git for linux, so what I’d do if I were you is to create an empty directory somewhere, open a command line console, cd to the new directory and “clone” the repository. Much like what the wiki says here:

http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Windows/msvc/CMake

it might be possible to move things from where you already dowloaded them but I don’t know git, version control systems, remote repository stuff or anything else of that sort.

So you want to add an ogre3d backend to render into the blender viewport for bge?

72% done pulling down the master :smiley:

I will try and help however I can, C++ looks like somewhere near Secondlife script, and Quake source code :smiley: