Dynamic shapes?

simed

05-02-2013 11:51:23

I have an interest in fitting a cylinder along a spline, to model say a bendy pipe. However the cylinder could move along the spline or the spline itself could change, so the shape would not be constant.

Does OP have any usefulness in this case, for dynamic procedural geometry?

mikachu

05-02-2013 12:57:15

At the moment, if you want dynamic procedural geometry, i.e geometry being changed each frame, you can destroy and recreate the mesh each time needed.
It would work, even if it's not very practical nor efficient.
I'll try to address that when I rework the way meshes are generated... (you would have an option to overwrite an existing mesh's vertex/index buffers, rather than just creating a new one)

simed

05-02-2013 13:58:57

I see. It strikes me that creating from scratch every frame would be a big performance drain. Although in the past I've done this with a skeletal rig and that is also pretty ugly... imagine a bone hierarchy 80 bones long!

My guess would be that with the current way OP does things, I would probably be better in this specific case to directly manipulate the entity if I need to do it per-frame (or even by shaders if I can figure out how).

Actually a side question... has anyone ever considered bringing GPU into the mix for procedural stuff?

mikachu

05-02-2013 14:22:43

I see. It strikes me that creating from scratch every frame would be a big performance drain.
Hard to tell without actually benchmarking it, I guess it would be ok if it's limited to a few meshes..
Actually a side question... has anyone ever considered bringing GPU into the mix for procedural stuff?
I thought about that, mainly to speed up texture generation, but it seems that the market is not very mature:
- DirectCompute/OpenGL Compute shaders : only available on cutting edge hardware.
- Cuda : only compatible with Nvidia -> no way
- OpenCL : last revision (1.2) has not been ported to Nvidia cards, otherwise it sounds ok (need a reasonably recent GPU, too)

If I were going to write GPGPU code, I would probably go with OpenCL, but I would have to port and maintain all the code to that language, and I already got many things to implement, so it's rather low on my todo list...

Zonder

05-02-2013 15:50:57

Maybe an addition could be to procedurally generate an animated mesh. Of course you will need to deal with skeleton hook up in the generation and I never looked at how the format works at all but makes me wonder :)

jokoon

06-09-2013 11:09:53

Well that also means an editor could be made.

Klaim

07-09-2013 16:11:21

I will have a use of dynamic shape in this following case: I have "nodes" which are represented as extruded octogones. Each one of their external face have a "link" to another node. The "link" is visually a path between two nodes. I don't know yet what it will look like exactly, but it will be procedurally generated so that I can place nodes in space and links meshes are generated so that it form a curve between nodes. Currently, having an immutable world is ok. However, I need to build an editor which will allow moving nodes arround and links with them.
Basically, I will need to rebuild a link each time a node is moved. It don't look very efficient indeed.
For pictures of the kind of look I want: http://blog.klaimsden.net/?p=386
Links are the green parts.

Also, in this game, it is possible that the visual representation of the game gets...."hacked". One thing I would like to allow is modifying the position of all the nodes, so that it becomes disturbing for the player (like the background of Rez which moves on the music beat, if you played it you see what I mean *__*)

Basically, any way to allow me to modify in real-time the graphic setup is a bonus in my game and can be used as a gameplay feature.

I would try to help with this problem if I didn't have already too much problems to fix before stabilization, and there is also the fact that I have no idea how to make these kind of modyfying meshes things efficiently (other than bombarding the gpu with mesh updates from cpu).

jokoon

07-09-2013 18:55:57

Klaim shouldn't you use skeletal animation ?

Basically you have bones and the skin follows the movement of the individual bones, also depending on weights. Maybe not convenient enough for your case, I don't know.

Klaim

07-09-2013 20:52:29

It would mean the whole node+link set is one mesh? if yes, then it's not appropriate. Otherwise, well, I didn't think about using skeleton for this but it might work well.
It depends if it is possible to apply transformations on runtime easily. I never work with meshes with skeleton so I'm not used to how Ogre handle this.

Muhsan12

11-11-2014 05:57:38

It strikes me that creating from scratch every frame would be a big performance drain. Although in the past I've done this with a skeletal rig and that is also pretty ugly... imagine a bone hierarchy 80 bones long!