Irrlicht 2.0 - What's in store for the future!

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by devsh »

Personally, I like having the function implementations all in front of me rather than trying to figure out the STL.
So we're going to maintain code and features in a C++ engine for people who havent learnt C++ properly?


I'm sorry if a lot of this see schizophrenic and disconnected, but I am typing with terrible neck/shoulder pain which is terribly distracting.


Fixed Pipeline is bad because its being emulated in your driver adding tons of overhead (you have a single unified shader emulating all combinations of fixed function pipeline settings, wasting ALU cycles on if statements etc.) let me give you an example:
+A for loop is inside the emulation shader for fixed function lights (8 loops with full lighting calc)
+If statement for fog is present
+albedo texture gets sampled and multiplied by (ambient color+diffuse color*lightColAccum) and emissive is added
+if statement for alpha ref testing

Now if you desire to just draw textured objects without any lights you do 1 sample and thats it, with fixed function emulation you have 2 if statements, at least 1 eval of light loop control statement, 1 mul by diffuse which dont do anything
Basically your pixel shader can be many times slower with FF
Not only that but stuff like alpha testing gets added at the end of your pixel shader if you have your own (after you write to gl_FragColor), so it makes all shaders slower... not just FixedFunction pipeline emulation (EMT_SOLID etc.). The alpha test also gets added at the end, and not earlier (i.e. just after you sample a texture and before you start calculating lighting - so you calculate light for transparent pixels), and if you add your own alpha test, the one at the end is there anyway.

Personally I think we should make a shader pre-processor for GLSL (HLSL already has one I think) so you can use #include files which can define some routines that can be supplied with the engine, like hardware skinning, cook-torrance lighting model, fresnel calculation, blinn-phong lighting, spheremap sampling, and whatever you may need for deferred rendering etc.
(We could share around the functions as addons/patches/extras instead of clogging the codebase maybe)

Streamed assets loading is a bitch, trust me... if you do it wrong (VBO upload in irrlicht! YOU GUYS UPLOAD NEW MESHBUFFER DATA RIGHT INTO A VBO RIGHT BEFORE A DRAW CALL USING THE SAME VBO) then you make massive CPU<->GPU stalls and lose tons of performance. Before you jump into that pool I would rather encourage a full implementation of GPU side buffers and handling/managing them (i.e. copying between a VBO and a FBO/texture etc. - very useful for GPU particles). I really have a big problem with how unexposed irrlicht VBOs are etc.

You also need to expose the GPU buffers if you want to introduce transform feedback and compute shaders. Without the freedom of manipulating GPU-side buffers, transform feedback makes no sense.

I myself, have slimmed down the irrlicht engine and I only have 2 or 3 built in materials which are simple pass-through shaders (EMT_SOLID, EMT_TRANSPARENT_ALPHA_CHANNEL, something else )

On the subject of writing a custom Physics engine:
+JUST NO, its like asking for a second software renderer when you look at alternatives like Bullet!
+Cant diversify that far with just 2 or 3 active Irrlicht devs
+Rendering which is the principal focus of this library is falling behind the times and needs to catch up with current technology and thats where all the focus needs to go

Collision detection in irrlicht as of now, is super bad.. when I removed it from Build a World I saved over 300mb of RAM from the triangle selectors!
However collision detection, is quite acceptable compared to the GUI. There is only 1 tutorial on how to use it and its use is not encouraged, with the GUI its the complete opposite story.
Irrlicht GUI is the principal reason why your FPS may drop by even 50%. Its really inefficient bad GUI, from resolving mouse clicks and hovers etc.. (no quad-tree likstructure to avoid texting each gui element against mouse position) to the amount of draw calls (one per every single button and separate text frame, drawing one image at a time) and shader/material confusion and the inability to order stuff into layers (in a proper game-ready optimized GUI you draw the entire GUI at once layer by layer with a large vertex buffer and textures {fonts, button backgrounds, etc.} in either an atlas or texture array)

Instead of a better IRRedit, I would propose... lets write a Blender file importer or a Blender plugin (but please not one that writes to XML, that stuff gives a loading time of 10 minutes for a 100mb file - tried it before with a detailed 30k vert tree model, not only did it take ages to load but the plaintext storage inflated the filesize to many times over the .obj equivalent) so you can use Blender as a level editing tool?

I would propose to ditch XML and adopt google-protocol-buffers which enables forward compatibile serialization buffers which can be saved in a binary file, validated and can handle errors (you can check if fields are missing etc.).


We need 3d textures badly (VGXI, voxelizing, color charts for color correction) and all sorts of MRT rendering (geometry shader MRT layers for PSSM/CSM)
(about to start making an offline GPU asset voxelizing and voxel handling library with simple compression, but thats gonna be in the Project Announcements section soon... may be made LGPL in return for people willing to help and spread the development load)

On the question of animations, maybe incorporate Smart Body?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by CuteAlien »

@devsh: You are right that the amount of draw-calls in the GUI should be reduced. Especially text-rendering should be cached. Well, there's nothing in the architecture that prevents such optimizations, that's simply not yet coded. Btw, you can sometimes save a lot of draw-calls when you disable border and background rendering for buttons (as you generally use scaled textures). The testing of the mouse-cursor in the GUI is no bottleneck unless you have an incredible huge amounts of elements all on the same level (it's just testing a 2d coordinate against a rect, you can do a few thousand of those before it starts to matter).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Irrlicht 2.0 - What's in store for the future!

Post by hendu »

On SmartBody: I recently looked into it, and what it would gain for my project. The summary:
- I would only gain animation blending and a few ready animations
- the cost would be a huge amount of new dependencies, manual skeleton retargeting
- the lip sync requires special preprocessing of each sound file with manually matched text, as well as a lot of manual retargeting

It was not worth it for me. Most parts of it were not useful, and mere animation blending and a readymade walk cycle are not worth so many dependencies.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht 2.0 - What's in store for the future!

Post by Nadro »

@devsh
Some issues related to hardware buffers (eg. VBO) handling are fixed in shader-pipeline branch, where you can use double buffering, manually upload data to GPU etc. In the future the next improvements will be available in this case, current IHardwareBuffer stuff is still under development.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by christianclavet »

@hendu thanks for reporting on Smartbody. I was curious about this one. Perhaps if later they can reduce the dependancy, this could be a nice ADDON. Currently, for the animation system we have, we would only need a little more "love" on it. Luke and other devs has done a really good job so far, it's just need to have little more changes.

The current problem with the system right now, is the animation data that is directly in the mesh and not easily accessible. Here are things I'm thinking we could do with it:
Create a new class/container that would contain the animation data for a mesh skeleton:
  • the loaders would load as before but put their animation data in that container
  • Having getter and setter for theses containers: ex: AnimationData* getAnimationData(), setAnimationData()
  • since that container would be accessible, we could reference the data to another mesh as we used for a single instance before (useAnimationFrom()). We would need to find a cleaner way so the animation data is apply to a SINGLE instance and not all the instances of the mesh. I found a way to make it work, but I have to tamper with the mesh cache, so each mesh instances are separate.
  • since this container have all the data for the animation, we could have helper functions (insert, append, delete, with a frame range)
  • If we have helper function, we could create named animations with a frame range (.X and .B3D support named animation, perhaps improve the loaders for theses formats)
  • by modifying a little the bone class, we could define useAnimationFrom() that would use this container, so we could specify different animation for each bones (so we would be able to create a run animation for the legs, and aim for the arms. The only problem to check for would be the playback. (Since all animations would not have the same frame range)
  • We could create a new command for loaders that would load only the animation data in this container: (ex: AnimationData* loadAnimation() )
The idea with this container, is that the mesh reference don't need it directly. I would need to be separate (not in the mesh but in the node), and the mesh use a "default" reference from this container (from the loader). In each animated node, we could change the information for the animation data. I think that the material data work this way, if we modify materials for a node, it doesn't affect all the mesh instances as it's doing now with the animations data.

Still this would create some changes in the API and could perhaps break it a little. So since we have so few active developers, I'm not counting to have stuff like this in Irrlicht 2.0, perhaps 2.1 if we're really lucky.

Note: we already have animation blending. Sometimes, I have some problem with it because of a bad reference frame, but if the model is saved correctly it work.
Edit: Would be interesting to have also animation data for vertices not just bones. So we could perhaps add a VTA format (FLEX Animation) loader to have expressions on characters (https://developer.valvesoftware.com/wiki/Flex_animation), perhaps if someone work on a FBX loader could apply the MORPHS to the vertex animation data!

I know that we can control a bone directly by code, but is it possible to control a bone or bones by code and also playback an animation at the same time? (Could use this to turn the head, or create rag-dolls, or aim)
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlicht 2.0 - What's in store for the future!

Post by mongoose7 »

You know you can write your own animation system, like SmartBody did? For myself, I am thinking of a text-based system. Read the skeleton and create bones; read the animation and apply it to the bones. You could also have separate animations for two halves of a model, and apply animations conditionally to meshes.
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Irrlicht 2.0 - What's in store for the future!

Post by chronologicaldot »

Thanks everyone who answered my question!

@devsh
It's not that I can't use STL. But I happen to prefer modifying even basic classes, even if only for testing out ideas. So I guess I can save my own bits of irrlicht for personal projects, but whatever.
Also, for me at least, the GUI system only slows down when using transparency because of the alpha blending. Even on Burnings without transparency, it runs fine. Although, yes, the draw calls could be reduced.
Speaking of the Google protocol buffers - I looked at it, and it's just stored in JSON format without the commas, meaning it almost allows for interchange between Copperlicht and irrlicht. I like the idea of using JSON, but we would end up having legacy support for those whose stuff still loaded based on XML. It would also outdate the irrlicht exporter for Blender, which is a very convenient tool atm.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by devsh »

protocol buffers are beautiful because you define your protocols by specifying the data they contain and the presence of that data (obligatory or optional), then you run ./protoc and that compiles nice .h anc .c files that go in your project which automatically create the backends of data handling classes/structs so you dont have to code all the validation/verification on serializing and deserializing which makes the whole process very easy and nice (no serializing classes written by hand)
cat.exe
Posts: 34
Joined: Sat Sep 14, 2013 11:52 pm

Re: Irrlicht 2.0 - What's in store for the future!

Post by cat.exe »

If we do make the switch to c++11 standard, I'd really like to see ITimer support micro and even nanoseconds (courtesy of std::chrono::high_resolution_clock) and perhaps even a built-in sleep function (using windows Sleep() and Linux nanosleep()). This would save headaches for applications that need high-precision timers and not leave too much of a footprint on the irrlicht library.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by CuteAlien »

We already have a sleep function in IrrlichtDevice.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
cat.exe
Posts: 34
Joined: Sat Sep 14, 2013 11:52 pm

Re: Irrlicht 2.0 - What's in store for the future!

Post by cat.exe »

Good, looks like we're ahead of schedule.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht 2.0 - What's in store for the future!

Post by Nadro »

devsh wrote:C++x11 still causes problems for nvidia CUDA
imho in v2.0 we should use C++11 features, I don't see any relationship between Irrlicht and CUDA.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Irrlicht 2.0 - What's in store for the future!

Post by devsh »

irrlicht <-> CUDA interop

or more basically speaking, using CUDA and irrlicht in the same application without having to partition the CUDA part into a separately built library
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht 2.0 - What's in store for the future!

Post by Nadro »

Of course users may want to use CUDA in irr apps, but it's the same situation like with the other libs. As long as we don't integrate some libs into irr core, we shouldn't watch on external libs issues when we talk about implementation of some standard like C++11 in this case, because it could have negative impact for irr development process. Lib provider should fix those issues yourself. I hope that you understand my statement. Anyway I think that NV will fix those issues before v2.0 release ;)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply