billboard scene node : constant size ?
billboard scene node : constant size ?
I need a billboard scene node that remains constant in size (in terms of the overall screen) regardless of how close I am to it.
Has anyone made something like this, or does anyone have any ideas on how to do it? (I am not keen on re-scaling the billboard scene node every frame to keep the screen size constant.)
Alternatively: Is there a way to make a 2D image (ie, via "draw2DImage") recognize the z-buffer?
Has anyone made something like this, or does anyone have any ideas on how to do it? (I am not keen on re-scaling the billboard scene node every frame to keep the screen size constant.)
Alternatively: Is there a way to make a 2D image (ie, via "draw2DImage") recognize the z-buffer?
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Actually u can do this without a shader maybe even faster dunno.
you simply set the view,projection and world matrix to identiy and then render a simple rect to the screen. The position of the rec has to be between -1,-1,0 and 1,1,0
you simply set the view,projection and world matrix to identiy and then render a simple rect to the screen. The position of the rec has to be between -1,-1,0 and 1,1,0
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: billboard scene node : constant size ?
this would be much easier..agamemnus wrote: Alternatively: Is there a way to make a 2D image (ie, via "draw2DImage") recognize the z-buffer?
http://irrlicht.sourceforge.net/docu/example009.html
just type in "logo" into the browser search
never thought of how the Irrlicht logo is drawn??
Re: billboard scene node : constant size ?
Sorry, but what you mean is drawn screen-aligned, not world aligned, what agamemnus tries to achieve.random wrote:this would be much easier..agamemnus wrote: Alternatively: Is there a way to make a 2D image (ie, via "draw2DImage") recognize the z-buffer?
http://irrlicht.sourceforge.net/docu/example009.html
just type in "logo" into the browser search
never thought of how the Irrlicht logo is drawn??
Two simple approaches (if that's what you're looking for):
- Use the distance cam<->obj to determine the scaling of the node to achieve the intended impression
- draw a quad with the texture on it and assign it to an IMeshSceneNode
beer->setMotivationCallback(this);
Re: billboard scene node : constant size ?
Sorry, but what you mean is drawn screen-aligned, not world aligned, what agamemnus tries to achieve.
what do you think he meant???I need a billboard scene node that remains constant in size (in terms of the overall screen)
...
Alternatively: Is there a way to make a 2D image (ie, via "draw2DImage") recognize the z-buffer?
why else would he ask about whether a billboard that fills the whole screen or an image(which is screen aligned) and reminds of the z-buffer?
Re: billboard scene node : constant size ?
Random you drunk again??random wrote: what do you think he meant???
![]()
why else would he ask about whether a billboard that fills the whole screen or an image and reminds of the z-buffer?
Can't you read?
Scene node FYI is a thing that lies in 3D space, if you had forgotten about it.I need a billboard scene node that remains constant in size (in terms of the overall screen) regardless of how close I am to it.
And when he said about z-buffer is i think he wants it to be partially behind some objects(that are in front of it).
I think he need something like player nick name(tough maybe, it will be an image or sth else. idk) over player node.Tough I don't know how as I haven't worked with this stuff, tough It might be good to know for me too as I would like to have something like this for when I'm going to build my level editor.
Working on game: Marrbles (Currently stopped).
Thanks for the responses,
The size of each node should stay constant relative to the screen size.
The position should be an in-world position.
The rotation should be facing the camera.
It should be blocked by other 3D objects if they are closer to the camera.
Radikalizm: Simple transformations not simple enough for me. Never did a shader so I wouldn't really know where to start with any of that.
Sudi: That's what I'm doing right now -- I'm rendering a set of rects, but there's no z-buffering in that so it looks bad at certain angles where a rect is seen through models that are closer to the camera than the rect.
random: Like polylux said, I need z-buffering (as if it was a 3D object) and world positioning. That logo just stays in one place, drawing over everything else.
serengeor: On the money! It's actually flags that are over models to represent what player they belong to.
---
I have a feeling that what I'm looking to achieve might be computationally expensive (re-scaling the nodes every frame). If there's no easy solution I might just have a combination: 2D drawRect flags if I'm at the bird's eye view zoom level, switching to all 3D flags closer.
The size of each node should stay constant relative to the screen size.
The position should be an in-world position.
The rotation should be facing the camera.
It should be blocked by other 3D objects if they are closer to the camera.
Radikalizm: Simple transformations not simple enough for me. Never did a shader so I wouldn't really know where to start with any of that.
Sudi: That's what I'm doing right now -- I'm rendering a set of rects, but there's no z-buffering in that so it looks bad at certain angles where a rect is seen through models that are closer to the camera than the rect.
random: Like polylux said, I need z-buffering (as if it was a 3D object) and world positioning. That logo just stays in one place, drawing over everything else.
serengeor: On the money! It's actually flags that are over models to represent what player they belong to.
---
I have a feeling that what I'm looking to achieve might be computationally expensive (re-scaling the nodes every frame). If there's no easy solution I might just have a combination: 2D drawRect flags if I'm at the bird's eye view zoom level, switching to all 3D flags closer.
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Well, maybe it's time to learn, shaders and transformations aren't hard at all, you just have to take some time to get used to themagamemnus wrote: Simple transformations not simple enough for me. Never did a shader so I wouldn't really know where to start with any of that.
It'll make your programming life a lot easier, trust me
Maybe you have some links or know good e-books where he(also IRadikalizm wrote:Well, maybe it's time to learn, shaders and transformations aren't hard at all, you just have to take some time to get used to themagamemnus wrote: Simple transformations not simple enough for me. Never did a shader so I wouldn't really know where to start with any of that.
It'll make your programming life a lot easier, trust me
Working on game: Marrbles (Currently stopped).
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
I learned about shaders from different resourcesserengeor wrote:Maybe you have some links or know good e-books where he(also I) could start ?
First of all there are a lot of good tutorials available online, I can't remember which ones I used specifically, but googling for them should give some nice results
The MSDN database gives a good reference for using HLSL, I don't work in GLSL that much so I can't give you any programming references, although it's not too different from writing shaders in HLSL
I also used to examine source code of existing shaders to find out what they did, it might not be an ideal solution but it worked for me
Once you get familiar with the vertex shader -> pixel shader workflow and matrix and vector operations (which are really easy in HLSL/GLSL because of the provided functions for working with them) it all becomes rather easy
I taught that you might know some starter friendly tutorials, but eh, I will google them up when I need, its not like it would be hard for me 
Oh, and GLSL is for opengl, and hlsl is for directx right? If so, than I'll need to search for glsl tutorials, even if the difference is small, I want to be able to test them on my machine, since I'm working on linux.
Oh, and GLSL is for opengl, and hlsl is for directx right? If so, than I'll need to search for glsl tutorials, even if the difference is small, I want to be able to test them on my machine, since I'm working on linux.
Working on game: Marrbles (Currently stopped).
Re: billboard scene node : constant size ?
I dont drink, don´t compare me to yourself pls:)Random you drunk again??![]()
Anyway i better go on with porting project code from Irrlicht to OGRE:) that´s less waste of time:)
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Yes, GLSL is for OpenGL, HLSL is for DirectXserengeor wrote:I taught that you might know some starter friendly tutorials, but eh, I will google them up when I need, its not like it would be hard for me
Oh, and GLSL is for opengl, and hlsl is for directx right? If so, than I'll need to search for glsl tutorials, even if the difference is small, I want to be able to test them on my machine, since I'm working on linux.
The syntax for both is mostly the same, except for some different names for basic types (like float3 in HLSL = vec3 in GLSL) and the managing of shader input/output
I'm sorry I can't be of more help, but it's a long time ago since I was learning how to write shaders so I can't exactly remember the tutorials I used
EDIT:
You also have the option to write your shaders in Cg, a language resembling HLSL designed by Nvidia which can be used for both OpenGL and DirectX
I believe an irrlicht implementation for Cg shaders exists if you're interested
