Horde3D

Next-Generation Graphics Engine
It is currently 22.12.2024, 02:19

All times are UTC + 1 hour




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Per-vertex manipulation
PostPosted: 13.05.2007, 04:43 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
Is it or will it be possible to do per-vertex manipulation in Horde?

I'd like to be able to create primitives programmatically by setting vertex positions. I'd also like to be able to get vertex positions and move vertices.

Somewhat related, would it be possible to include functions which allow for the matching of 2D screen positions to 3D positions, allowing us to grab objects/vertices using the mouse?

I have some plans which could make use of all this :D

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 08:41 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
are you making a modeling app? :D


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 11:34 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
SpOOky wrote:
are you making a modeling app? :D


I would definitely consider trying something like that as a major long term project. None of the 3D apps I can afford really work the way I want them to.

The other thing is that I like doing static 3D images. I've got a page up showing some things I've done.... http://homepages.ihug.com.au/~mabrown/ Recently I've been using an excellent free 3D renderer called Kerkythea.... http://www.kerkythea.net/joomla/ However, there is no way to introduce special effects such as smoke, fire etc into the rendered images. Doing things like smoke is very hard as post-pro in a paint package because the paint package has no idea about the original 3D geometry in the scene. These things also aren't repeatable or animatable. My thoughts on this are only half formed, but involve doing something like the post-pro effects possible in trueSpace using a plug-in called Primal Particles FX. This plug-in applies masked post-pro particle effects from within trueSpace to an already rendered image. I'm thinking that when Horde gets particles I might be able to do something similar which can take account of the scene geometry :shock:

Another thought is to create something which can animate a mesh to create waves. This is what I've basically done via trueSpace using a plug-in called Dynawave. Software like Realflow is a lot like Dynawave but with the addition of programmatically generated textures and particle effects to produce wakes, bow waves, spray etc. I really want these extra effects because again, these are very hard to do in a paint package. Dynawave only animates the geometry which isn't enough.

Probably dumb ideas? :oops: :D

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 12:05 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
you can easily do any of those things in blender. it has both particle and fluid simulations (blender feature list)

regarding the use of horde3d for vertex manipulation (for the ocean, right?) it can easily be done via a vertex shader


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 12:53 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
SpOOky wrote:
you can easily do any of those things in blender. it has both particle and fluid simulations (blender feature list)


Unfortunately, Blender is the one app that I know I should learn. It is also the modelling app I like the least. This isn't a swipe at Blender or its fans, who I know love its power and its way of doing things. I'm afraid that I fall into the camp that really hates the Blender interface. Every time I try with Blender, I give up in frustration and go back to trueSpace. I've also found that Blender import/export doesn't play well with other apps. Its trueSpace .cob import creates objects which are correct except that they are many times broader than they should be. I've had obj's which are mostly correct except that one or more components are shifted in space. I really should use blender as it works with Kerkythea but I simply don't get it I'm afraid.

SpOOky wrote:
regarding the use of horde3d for vertex manipulation (for the ocean, right?) it can easily be done via a vertex shader


Ahhh, OK. I just did a google. So that's what a vertex shader is. That's not at all what I thought it would be. Thanks for the info Paul. Yes, I do want it for the ocean. Time to check the Horde docs and see what I can do with this.

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 12:59 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
initially i wasnt a big fan of blender`s interface either (i have learned 3d with the Autodesk Maya PLE), so i understand your frustration.

but in time, and making use of the fact that you can customize it, we became good friends.

paul


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 13:08 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
OK, just had a quick look at the api docs. I found a function called "getMeshData" with which I think I could get the mesh data. It also had the warning "Do never try to modify the data of the pointer since that can corrupt the engine's internal states!" So I guess I can't directly alter the data.

I couldn't see a corresponding "setMeshData" function. I think I will need an example of how to do this.

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 13.05.2007, 13:14 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
SpOOky wrote:
initially i wasnt a big fan of blender`s interface either (i have learned 3d with the Autodesk Maya PLE), so i understand your frustration.

but in time, and making use of the fact that you can customize it, we became good friends.

paul


I've tried a lot 3D apps most of which are no longer on my machine. Blender is still sitting there though because I *know* I should be using it. I'm very impressed with a lot of the blender stuff I have seen. Perhaps if I start a new project and use it from the get-go I will have more success, instead of trying to continue old trueSpace projects with it.

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 14.05.2007, 09:50 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Basically it is possible to have dynamic geometry in Horde but currently with some limitations. As spooky pointed out one way is to use vertex shaders. This is especially useful for doing procedural things like ocean waves with high performance.

The second way is to do the same as the Collada tool. The Horde geometry format is quite simple. So you can easily create your own geometry resource at runtime in memory and load it into the engine. After that you could also modify your vertex positions in realtime but it wouldn't be possible to add or remove vertices from your mesh. This is one of the concepts of Horde. You can modify the resource data but not the structure since that would require expensive memory reallocations and other calculations. So in the case of a texture image you could alter the pixel color values in realtime but not the dimensions or color depth of the texture without recreating it (which is expensive). But at the moment I don't have implemented a function to modify the vertex data for a resource that is already loaded. So the best is probably to use vertex shaders for your waves or the resource way I mentioned to create static objects.

By the way, the screenshots on your site look really promising :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 14.05.2007, 12:23 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
Thanks Nic for the info and the kind words about my images.

I am going to have to study this whole vertex shader thing. I really don't understand it I must admit. Do you think an example might be possible in a future release?

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 14.05.2007, 22:39 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Horde certainly needs some more samples but I have to look when I find the time for that. There are still so many other things to do, although the base features are not so far from being complete now.

Here is an excellent tutorial which covers shaders in GLSL, the shader language Horde is using:

http://www.lighthouse3d.com/opengl/glsl/

Might be you want to have a look to help you get started.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 04:28 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
marciano wrote:
Here is an excellent tutorial which covers shaders in GLSL, the shader language Horde is using:

http://www.lighthouse3d.com/opengl/glsl/

Might be you want to have a look to help you get started.


Hi Nic,

I've taken a quick look, thanks for the link. Before I get too deep into the tutorial, I need to work out how I am going to do this in Euphoria. Am I right in thinking the following...

1. glsl shaders are compiled at run-time?
2. the glsl shader is passed to ogl as a C-like program string?
3. that certain functions in ogl are used to pass the glsl program string to ogl for compilation and execution?

Point 3 is important to me. I am assuming that functions like "glCompileShader" should be available in an ogl dll somewhere on my system. I will need to wrap those functions for use in Euphoria. Unfortunately, I can't seem to find the dll on my system which exports these functions. Do you know of a link which tells me which ogl dlls should export which ogl functions?

Many apologies if this should be obvious. Once I can confirm I can use shaders with Horde from Euphoria I will be able to dig further into the tutorial. I can see this has a *lot* of possibilities.

EDIT: I found the following link which I think explains why I can't see glCompileShader in opengl32.dll http://opengl.org/resources/code/samples/sig99/advanced99/notes/node396.html

I gather that I'm going to need to use wglGetProcAddress to do this.

More wrapping to do :roll:

All the best,

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 08:40 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hi Mark,

you don't have to take any care of this, Horde is doing that for you! All you need to do is write the shader code in the *.shader.xml files that can be used by Horde. The complete shader loading, compiling and data exchange with OpenGL is done by the engine and you won't need to (actually can't) touch any OpenGL functions directly. Sorry, might be I should have said that you can ignore the complete OpenGL setup part in the tutorial, but I thought that was obvious. :?
Anyway, it is enough to see how the GLSL syntax is working.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 09:44 
Offline

Joined: 03.05.2007, 11:26
Posts: 26
marciano wrote:
Hi Mark,

you don't have to take any care of this, Horde is doing that for you! All you need to do is write the shader code in the *.shader.xml files that can be used by Horde. The complete shader loading, compiling and data exchange with OpenGL is done by the engine and you won't need to (actually can't) touch any OpenGL functions directly. Sorry, might be I should have said that you can ignore the complete OpenGL setup part in the tutorial, but I thought that was obvious. :?
Anyway, it is enough to see how the GLSL syntax is working.


Ahhh, OK :roll: That's great :D

I probably should have realised this. I can be a bit slow I'm afraid :oops:

I'm going to go and try this now. Get ready for the next silly question.... :?

Mark


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 21:36 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
mabrown wrote:
Ahhh, OK :roll: That's great :D

I probably should have realised this. I can be a bit slow I'm afraid :oops:

I'm going to go and try this now. Get ready for the next silly question.... :?


Don't worry, you are new to all this and graphics programming really isn't that trivial... ;)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group