View previous topic :: View next topic |
Author |
Message |
Mike Member
Joined: 15 Mar 2006 Posts: 7
|
Posted: Wed Mar 15, 2006 7:26 pm Post subject: Sprites |
|
|
Hi,
I wonder if you guys can help me with this. I want to place sprites and billboards in my map and then load them in my game with the dmf file (I use Irrlicht for rendering). How can I achieve this? I'm writing in the plugins section because I suppose this is what I will have to write. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Wed Mar 15, 2006 10:33 pm Post subject: |
|
|
Hi there mike, and welcome!
Quick answer: maybe using simple rectangles and their Tag property might help for sprites? Just a thought. |
|
Back to top |
|
|
Mike Member
Joined: 15 Mar 2006 Posts: 7
|
Posted: Thu Mar 16, 2006 5:20 pm Post subject: |
|
|
Thanks, that sounds reasonable.
So after that I need to load the file, check which are sprites (using for example a name prefix) and add them myself? |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Thu Mar 16, 2006 5:36 pm Post subject: |
|
|
Using the name of the object is another way to distinguish objects from eachother but it is less flexible than using the Tag property. In other words, I would not mix the name with other info you would like to store with the object. The Tag property is a simple string field in which you can use any information you need. For example, you could put in the word "sprite" in the Tag propery, load your file and check each object's Tag property for the word "sprite".
Anyway, when talking about sprites, I think of 2D objects rather than 3D objects. However, using 3d rectangles might be helpful here anyway, and more flexible too as you can manipulate the geometry easily. Btw, why do you need sprites anyway? |
|
Back to top |
|
|
Mike Member
Joined: 15 Mar 2006 Posts: 7
|
Posted: Thu Mar 16, 2006 8:56 pm Post subject: |
|
|
I got it working. I still need to calculate the rotation from the vertices. I use the name and tag property.
//Btw, why do you need sprites anyway?
I need sprites for objects that don't need polygonal representation. Billboards are a good example, for placing stuff like lights, or for making trees, grass. I think a map editor needs something like this, I don't know why I'm the first person to ask for this. |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Thu Mar 16, 2006 10:16 pm Post subject: |
|
|
Mike wrote: |
I don't know why I'm the first person to ask for this. |
Because billboarding for objects is a technique from the last era gone by. Entities are usually all 3d these days, except for some extreme or rare cases. _________________
|
|
Back to top |
|
|
CMe Member
Joined: 30 Jun 2005 Posts: 72 Location: Ontario Canada
|
Posted: Fri Mar 17, 2006 12:58 am Post subject: |
|
|
Billboards still have a place in modern scenes, and are becoming more popular. Scenes are getting more complex. Imposters are becoming quite useful for caching a detailed mesh as an image for rendering at a distance where the difference in quality will not be that noticible. We generally focus more on things in the foreground. Especially useful if there will be many instances of the same object. So basically it works as level of detail (LOD) system. |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Fri Mar 17, 2006 1:03 am Post subject: |
|
|
CMe wrote: |
Billboards still have a place in modern scenes, and are becoming more popular. Scenes are getting more complex. Imposters are becoming quite useful for caching a detailed mesh as an image for rendering at a distance where the difference in quality will not be that noticible. We generally focus more on things in the foreground. Especially useful if there will be many instances of the same object. So basically it works as level of detail (LOD) system. |
I was talking in the context of a placed entity. Heh, I remmber back in the day making Duke maps and placing fire heidrant sprites, and desks, and they were always facing you, even from 300 feet in the air with a jetpack.
Yes, I heard about that in Shadow Of The Collosus. They use that on the distant terrain or something like that. But that's not something you would place. It's done dynamically at a distance. Would work nice on trees at a very far distance.
Otherwise, billboards are for particles and things of that kind. _________________
|
|
Back to top |
|
|
CMe Member
Joined: 30 Jun 2005 Posts: 72 Location: Ontario Canada
|
Posted: Fri Mar 17, 2006 1:09 am Post subject: |
|
|
yeah I agree, static placed billboards aren't really that appealing these days. |
|
Back to top |
|
|
Mike Member
Joined: 15 Mar 2006 Posts: 7
|
Posted: Fri Mar 17, 2006 1:12 pm Post subject: |
|
|
What about clouds? Grass? I think nobody uses polygons for representing a single straw of grass?
And don't tell me lights are done with polygons, unless they are dynamically created.
EDIT:
Any tips on creating a plugin for automatic creation of these sprites? To generate the tag properties from some edit boxes for example. |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Fri Mar 17, 2006 9:39 pm Post subject: |
|
|
Mike wrote: |
What about clouds? Grass? I think nobody uses polygons for representing a single straw of grass? |
Everything in a 3d engine is 3d geometry. 'Sprites' are just quads. You use quads that are rotated towards the camera. And this stuff is not always placed. You don't really need a plugin for this stuff, it can be achieve with the usertag.
Clouds would be placed at runtime in your sky. They only have positions in your skybox, relative to the camera.
If you want to put some grass there are a few ways to do it. type vfx_grass or something in the user info section of your objects that are textured for grass, and then at runtime you can draw your qauds on these surfaces.
You could just place the quads and label them as grass quads, but it's better to do these at runtime.. because usually you only draw grass quads in the close range, and fade them out at a distance.
By light, you mean the halo around a light right? That's also a special effect. You could place a quad there and write something, but it would be easier just to write something in the usertag of the object that is your 'lightbulb'. like vfx_lighthalo_X and then that means you spawn a light halo particle directly on the object.
Does that make sense?
Welcome to the board btw. _________________
|
|
Back to top |
|
|
Mike Member
Joined: 15 Mar 2006 Posts: 7
|
Posted: Sat Mar 18, 2006 11:43 am Post subject: |
|
|
I understand what you are saying, it's just that my engine is kind of unique because it mixes 2D with 3D. I already have it working, but I would like to add sprites automatically. Because now the artist must place a rectangle and fill carefully the tag properties. There are 7 or 8 properties because I define animated sprites. What I would like is a little window where you would define the sprite and then it would automatically fill the tag property with values frm edit boxes for example.
Quote: |
Welcome to the board btw. |
Thank you:). |
|
Back to top |
|
|
|