How do I implement a new rendering engine?

Started by
9 comments, last by runonthespot 10 years, 10 months ago

I know that a game shouldn't be defined by its graphics. I think that having "eye candy" graphics, that your game would just be a lot better. I have yet to find a free game engine that looks as nice as cry engine 3. I know cry engine 3 is free, but you must share your revenue if you plan to sell it commercially. I have recently found out that if you were to make the most photo realistic models in a 3D modeling program (blender, 3ds max, etc), it wouldn't matter when you export it to the game engine. This is because the 3D modeling program and the game engine both had different rendering engines. I am slightly confused on what OpenGL and DirectX or Direct3D are. I know they are a set of functions in a programming language that allow you to communicate with the graphics card; are they a rendering engine? I will assume that they are for now. Since this is the case why is it that most game engines like Torque3D, Unity3D, and others, don't look like Cry Engine 3? Can't they all use OpenGL or DirectX and make the same stunning results that Crytek offers? I understand that game engines can't do this because computers or consoles won't be able to handle it, but they should at least make it an option. I was thinking of making my own render engine(something that looks Crytek's render engine) to then implement into Torque3D, mainly because it's a full blown engine under the MIT license. My question is this: How the hell do I, do this? Also, what is OpenGL and DirectX, are those just ways to communicate with the gpu? Which means, I would need to use those to make my render engine.

Any help would be greatly appreciated. I understand this could take the rest of my life. I do know programming, I learned Java, and I am continuing to learn. I wish for no hate below. I know this is hard, but I want to try. Don't tell me to use an already made game engine or rendering engine.

https://lh6.googleusercontent.com/_N3W3ksl-Xiw/TZA7Ykan7NI/AAAAAAAACdw/6ZaudnTIKTg/s1600/natural_lightingip9f.jpg

It looks so nice.

Thank you.

Advertisement

First off, avoid the all caps titles in the future. Second, if you are confused by OpenGL/DirectX/Direct3D you are seriously going to need to learn a lot before this subject makes any sense to you. As to not wanting hate, sorry, can't help you with that, you are going to need to learn a lot before any of this makes any sense. But, in general, you need to correct your understanding about rendering engines, the usual difference between many engines is not so much what they can do but more the content used in the demo's, Cry and others have massive funding to make everything look as best as possible, that's mostly the content, not the renderer making things look so nice. Many (well at least Ogre and one or two others) open source engines can come very close given the same level of content polish. Sorry, you have a lot to learn..

OpenGL and DirectX aren't rendering engines. No. They are graphics pipeline interfaces which let you submit commands to the graphics card. Such as, "push this bunch of triangles onto the screen using this set of shaders". But you need to come up with the commands yourself. As you've probabled guessed, you can tell OpenGL to draw a million triangles in random locations on the screen, and the GPU will happily do it. But it won't look all that nice, will it? No, not really. It's a computer. It doesn't create stuff, it just executes instructions.

So you need to tell it how to render lighting, shadows, how to draw a realistic sky, how to shade textures properly, how to create a convincing camera, how to generate procedural content that doesn't look like complete crap, how to make tree leaves translucent, how to render fire, how to animate stuff, and so on, and so on, in a way that the graphics card will understand. Depending on how you do this, and on the quality of your assets (textures, and so on - that one is really important because the rest is more or less the same among all renderers) the end result will look more or less pleasing.

As an analogy to the DirectX/OpenGL thing, a computer can add and multiply numbers, but you need to come up with algorithms to actually do useful work.

Now your next question is going to be, "how do I make a rendering engine", the truth is, you won't be able to if you don't know what people want out of a rendering engine. If you are truly dedicated, you can try writing a game directly on top of DirectX and OpenGL, and then look at your finished code, pull out stuff that's got to do with graphics, create a library out of it, and rewrite your game using it, this will give you an idea of how a rendering engine is used. Then write another game, and you'll see there's stuff you need that your library doesn't do yet! So add it in, and try again. And again. When it's sufficiently polished, submit it to the world to see what they think, and iterate until you get something really good.

But keep in mind that the odds of you alone creating the next big thing in rendering engines are close to nil. Engines like CryEngine or Torque3D have - literally - millions of man hours behind them, and have bumped into problems that you cannot even imagine yet (and solved them). So you'd be mostly reinventing the wheel, which is fine as a learning exercise but if you're trying to make money making games, creating your own rendering engine is probably not cost-effective (at least not when starting out).

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


that's mostly the content, not the renderer making things look so nice

I don't think so. I have for the past year and half been trying to decide what game engine would be best to create a game in. I have used the UDK, Unity3D, and Cry Engine 3 Free SDK, I created a model in blender and added in nice textures and materials, and it looked well. I first imported it into the UDK. It looked fine but it wasn't the best. Then I imported it into the Unity. It was pretty shitty. I am not sure why, but it was. Then I imported it into Cry Engine, it was beautiful. It actually looked better then when I first made it. Keep in mind, I did try everything to make it look nice in all engines. They just didn't come out as nice as it did in Cry Engine.

Your modeling app is only rendering that model, and it's doing it in not real time. Rendering engines need to render a bunch of models at high frame rates, all while doing all of the other logic involved in games.

Frankly, the odds of your game making any profit are nil. Just use cryengine.


that's mostly the content, not the renderer making things look so nice

I don't think so. I have for the past year and half been trying to decide what game engine would be best to create a game in. I have used the UDK, Unity3D, and Cry Engine 3 Free SDK, I created a model in blender and added in nice textures and materials, and it looked well. I first imported it into the UDK. It looked fine but it wasn't the best. Then I imported it into the Unity. It was pretty shitty. I am not sure why, but it was. Then I imported it into Cry Engine, it was beautiful. It actually looked better then when I first made it. Keep in mind, I did try everything to make it look nice in all engines. They just didn't come out as nice as it did in Cry Engine.

Then why dont you include some screenshots of each, and we can tell you why they dont look the same.

Generally you'll see differences if the engine doesnt support some features of the material setup you created in the modelling program. Or maybe the engine is downsampling the textures, or whatever else. The there's post-effects to consider.

The reason that games with these engines look different is usually mainly the art assets. Second is the effects like shadowing or HDR that may be missing or not as good in some engines. Then there may be differences in what material properties like normal-mapping that get imported... stuff like that.

A word of advice from someone who asked the same question as you and ignored all the answers: Don't. Just don't. Not now at least. It's not that you're not smart enough or not a good enough programmer. It's just that writing an abstract game engine is useless. I wrote and rewrote my "engine" so many times to fit my new rendering needs that i just gave up.

Instead i started to work on different aspects of a game (terrain, mesh, foliage and animation). Now i'm in the process of putting all the code together and building a rendering infrastructure and it's already ten times better than the "engine" i wrote before. So, knowing full well that there's a big chance that you will ignore my advice, please reconsider and don't waste your time. Write games and eventually you'll get an engine.

"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "


I created a model in blender and added in nice textures and materials, and it looked well. I first imported it into the UDK. It looked fine but it wasn't the best. Then I imported it into the Unity. It was pretty shitty. I am not sure why, but it was. Then I imported it into Cry Engine, it was beautiful.
In each of those tests, you're rendering the model with different shaders.

The shaders are also "content", not a fixed part of the engine.

Right, so, your problem stated is "My model doesn't look as nice in free game engines as it does in my modeller".

The solution to this is not to write your own rendering engine, it's to get to know the tools better.

Unity for example can look every bit as good as any other engine. It's all about understanding the tool.

A default shader on an object dropped into the scene in Unity is not going to look that great. To make a model look good, you need

-Pick a model that is appropriately set up for a game (taking into account number of polys, and setting up good default textures, spec maps, bump maps etc.

-Pick the right shader (Maybe cryengine chooses a prettier default shader... which doesn't necessarily make it the better choice.)

-Adjust textures to be appropriately sized and not too compressed

-Employ antialiasing (again, in Unity, probably not on by default)

-Light it properly.

In my view, work with any of those free tools, compose a complete scene, look at it objectively and get feedback on how you can improve it and basically iterate your skills. It's not ever going to be a 1 to 1 translation from 3ds Max or Maya. Also, think practically about how likely it is that one person will produce cryengine quality rendering, when it's taken a team of 10+ 4 or 5 years of full time work to reach that level.

By all means though, build your own rendering engine as a means to improve your understanding of the existing ones, or just as a learning exercise, because the more you know, the better use you can make of the ample resources out there.

Good luck mate smile.png

I have to oppose to few things:

It's not ever going to be a 1 to 1 translation from 3ds Max or Maya.

Honestly, if you know exact scene description, you can achieve 1 to 1 translation. Of course this means that you have to employ same shading models, same lighting conditions, same level of antialiasing, etc. The problem might occur if you compute global illumination in 3ds max (e.g. indirect lighting). As I presume we generally want engines to be realtime, I won't give you advice to actually perform path tracing, etc. -> but you can either pre-compute GI, or dynamically compute it using F.e. voxel cone tracing, instant radiosity, reflective shadow maps, imperfect shadow maps, etc. - there is like a TON of approximations of GI ... in this case it won't look the same though.

Also, think practically about how likely it is that one person will produce cryengine quality rendering, when it's taken a team of 10+ 4 or 5 years of full time work to reach that level.

Honestly, 10 people working on rendering engine will result in bloody mess. Also this depends on experience, one very high skilled man can also create Cryengine like renderer, it will take some time (depending on his experience). Less skilled people would have to learn (and this takes more time), people without knowledge would learn for a bunch of years before being able to actually create it.

All in all I must add that the quality of graphics strongly depends mainly on assets. The best rendering engine with bad assets is actually worse than quite worse rendering engine + very good assets, not even talking about average rendering engine + very good assets.

F.e. look at Skyrim, the rendering engine is not that good (actually it doesn't have that much capabilities), but it has beautiful assets, and the result is awesome.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

This topic is closed to new replies.

Advertisement