I'll try to get back on IRC this evening....
I am of the opinion that every feature you have mentioned is already possible without custom rendering.I might suggest then, that we add the ability for dynamic entity rendering. There are some absolutely awesome "can't live without it" cool features that are available when the modder has the ability to do custom rendering... The hook would be relatively simple: the renderer draws whatever object it wants, however it wants it, and Terasology places the resulting graphics object at the proper rotation, scale, and location in the scene. Custom death animations, custom morphing, all sorts of things then become available to the game... It can/should then be extended to items and blocks... Yes, I have custom models for items too...
The interface to Terasology should/can be relatively painless too. "register this renderer for this class of item/entity/block". Then, whenever Terasology wants to render that particular type of object/class in a scene, the registered renderer is called... Its all dynamic and on-the-fly.
Sorry for my awful explanation, but I'm still learning the proper terms... Please feel free to correct me, so I can improve our communications!
I will have to understand your system much better, which will take some digging... But in a nutshell, I'd like custom rendering because I want all the artificial limitations removed. For example, if I wanted to make a ghost that could fade in and out. Or maybe I'd like to make a lightning entity, that doesn't use boxes at all and has no fixed set of, well, anything. Or perhaps I'd just like to make a clone, and replace myself with the player! (speaking of which, replacing the standard player with a "minecraft-ish" one with user-customizable skins is also a goal for me) In other words, some sort of registration/replacement mechanism for the renderer of the current class of entity. And well, not just for entities... for blocks, for items, for armor, and whatever else. Why? Well, because it is absolutely amazing what some of the creative people out there can come up with... So, I will continue to ask for custom rendering... for everything... because it's needed... and it's probably not a good thing to put artificial restraints on yourself...I am of the opinion that every feature you have mentioned is already possible without custom rendering.
We have support for an asset called a Skeletal Mesh (you may already be familiar with this, in which case skip to next paragraph). This is basically a mesh that is controlled through the position/rotation/scale of a hierarchical structure of 'bones'. Each vertex of the mesh is associated with one or more bones, so changes to the bones pull the vertices along with them. For box-based mesh, you may just have a bone per box.
In Terasology each bone is an entity and can either be manipulated by playing an animation (another asset) or by programmatic manipulation. So long as a mesh is set up as a skeletal mesh, you can do all the animations you want. And because skeletal meshes are a standard asset type, you can also visually create animations in any of the standard modelling apps like blender and export it for use in game.
At the moment this is implemented through a technique called CPU skinning, which essentially means we generate the mesh each frame. But by having a single centralised way in which this is done we have a path for moving to the more efficient GPU skinning where the bone information is sent to the GPU and the mesh transformation is done there.
Even without a skeletal mesh you can create an entity hierarchy, attach static mesh to each entity and manipulate the hierarchy to achieve a similar outcome.
The one thing this doesn't handle is extreme mesh morphing - this can be done either using a shader, or by having a mesh that is modified as needed. So again doesn't require custom rendering, just a system to modify the mesh.
In general, I would tend away from per-entity custom rendering because:
- Without custom rendering we have rendering centralised to a few systems, driven from a few components. This allows us to make performance improvements and other enhancements in one place.
- It exposes implementation details. We currently use LWJGL for rendering, but we may change to use LibGDX or something else in the future. Having modules work through assets means the implementation can be changed. It is also difficult to handle big centralised features like deferred rendering,
- Performance again - assets can be shared across entities (and thus a smaller memory footprint)
Nice! Getting closer!Nice work, synopia. Unfortunately, I didn't immediately see anything I was doing differently.
But I did finally notice an incredibly-boneheaded mistake I made -- that I had been converting from degrees to radians and not the other way around.
That gets me "ALMOST" there.
View attachment 1524
I believe this is all doable under the current approach.I will have to understand your system much better, which will take some digging... But in a nutshell, I'd like custom rendering because I want all the artificial limitations removed. For example, if I wanted to make a ghost that could fade in and out. Or maybe I'd like to make a lightning entity, that doesn't use boxes at all and has no fixed set of, well, anything. Or perhaps I'd just like to make a clone, and replace myself with the player! (speaking of which, replacing the standard player with a "minecraft-ish" one with user-customizable skins is also a goal for me) In other words, some sort of registration/replacement mechanism for the renderer of the current class of entity. And well, not just for entities... for blocks, for items, for armor, and whatever else. Why? Well, because it is absolutely amazing what some of the creative people out there can come up with... So, I will continue to ask for custom rendering... for everything... because it's needed... and it's probably not a good thing to put artificial restraints on yourself...
See above, but in Terasology everything that exists is an entity or set of entities. A creature is certainly an entity, which happens to be the root of a hierarchy of entities for its skeleton. Each thing that has a unique location in the world is an entity, which is why it makes sense for a skeleton to be composed of entities - it allows you to attach other entities to the skeleton (like attaching a sword to a hand bone), find out whether than hand is touching something, check for collision against different limbs, etc.I think we need to clarify terms a little... when I refer to entity, it is an active object or animal/creature in the mod. What is it that you call one of your creatures? If bones are entities, then what are creatures?
This is about separating two concerns - how something appears and how appearance is rendered. If you want to change how something appears, there's no reason you should have to also mess with how it is rendered - all rendering is is drawing vertices with a given material. Otherwise, I don't know what to say - I firmly believe that nothing about this general approach is limiting. My experience is it is quite standard for 3D engines as well, and probably less limiting than many that don't support procedural meshes.I've also found, that for most of my players, their computer is, well, of the antique variety... I would not count on players having impressive graphics cards with GPUs that are hungry for vertices and skins. For probably 50% or more of players, the CPU and GPU are one in the same. While abstraction and adding layers of fluff to make everything invisible to the programmer is sometimes a good thing in the name of flexibility, it is also one of the biggest killers of performance. In other words, it's not worth it to try to be everything to everyone and be infinitely flexible. Give me low-overhead-down-and-dirty access...
In other words, it's not worth it to try to be everything to everyone and be infinitely flexible.
That is what I meant, yes.Immortius wrote:
"that latter would change us to working against OpenGL EL, which loses a lot of the older OpenGL methods (such as drawing lines/vertices directly - everything has to be done through buffers if I understand correctly)."
I believe you are referring to OpenGL ES, which indeed is buffer-oriented and targeting Embedded Systems (i.e. phones and tablets). Having only recently updated my knowledge on the matter I was a bit concerned about the change, but the more I read about it and the more it made sense. "Ancient" and new computers/platforms alike can greatly benefit from packing data into buffers first to then manipulate them later, potentially in multiple ways and in parallel.