Man this sucks... and Mr. Handy what was that...
Well you guys make some interesting points and I can certainly see value in using a 3D HUD.
A few points:
1. 3D, I'm not saying never do it. I'm saying you should probably do it in 2D.
2. Program Complexity. I tried to give the guy an easier solution. Saying things like well just rewrite the shader, or it's not much more work, aren't exactly helpful. I made a conscious attempt to try to avoid that kind of advice.
3. Something being possible is not the same as it being efficient or easy or quick.
4. I'm just trying to give good advice that promotes success and not failure.
Damn, ok some rebuttals:
Quote: "Different screen sizes And shapes see it in different places.
If you want to position a minimap on the right and keep it the same size for all resolutions, for a sprite you need to scale the sprite to take into account the screen resolution and then offset it to the left of the screen width(). With a 3D object, it won't need to be resized, and you just offset it from the right in the same way (screen x with (if using lock to screen). "
I agree. My thought on this is that with 2D you can choose to ignore scaling. You can let the player scale the hud as a setting, some games do this. I don't like this solution however, and I think your concern is warranted. I view this problem as being at least better to deal with than 3D Hud FOV/Perspective/Aspect Ratio scaling/positioning which I perceive as harder to deal with (but not impossible). Using "world units" is more difficult and annoying then merely using pixels.
Quote: "Screws up when Field Of View changes or is set at an extreme value.
Set object fov() will overcome that."
I was not aware of this command. The example code in the help docs doesn't run since it cant find it's media. I get the impression that it will negate FOV skewing, which would be nice. Thanks for sharing that.
Quote: "Can interfere with render passes and effects.
Not sure how?"
This is a blessing and a curse. For example if you are using an HDR shader, the HUD can end up being visible to the shader when it lights and blurs stuff. Or some other full screen effect. This isn't the only example, and sometimes this can be good. It can be problematic but it's not an impossible situation. You might find you need to hide the hud between render passes. If the odd chance the shader needed to be rewritten do this then it's not a realistic option for most people although technically possible. Adding another pass to draw the Hud can have negative a performance impact. Just some of the stuff i was worried about.
Quote: "2D overlay elements require more work to position accurately.
Yes, but very marginal. Object screen x/y commands give you the screen coord of your objects, then you just postion proportionally. However, it'd probably be best to use planes for objects though, and then you'd use the object coords.
"
I wrote my comment thinking exactly this. My thought is that reliably dealing with a FOV that is actively expanding/contracting (effect like gradual zooming of a sniper scope) with any random screen aspect ratio, would make it messy to deal with. Again not impossible, just a total pain in the butt. Your comment above seems to improve this some.
Quote: "Can't easily add 3D overlays like map markers.
Just another 3D plane positioned proportionally. You still have to use computed values if you're dealing with dynamically positioned/resized sprites based on an unknown screen resolution."
I agree. Honestly I believe I was over simplifying things here. When you paste a map onto the screen its simple math to find the center and add whatever offset X/Y you need to paste a marker. If it's all rotated then it'll be a pain. But with 3D you have all that plus you need to figure out a separate X and Y scale for the offset of the marker from the center (or whatever) of the map plane. It's great you can find the center of a 3D plane on screen, if something needs to be placed on the edge, how do you find the X/Y of the edge? It's certainly possible, just more work, but I'm considering overall difficulty and complexity here. That's the priority I gave my advice above.
Quote: "People usually can't make the map completely 3D and resort to mixing 2D and 3D.
Those people need to learn how easy it is then!
"
I'm just thinking about difficulty here. I'm trying to help in a way that will make things easier. Yes people do (right or wrong) mix 2D and 3D elements. I think I go a bit far with my statement saying people usually do this, but its also not good to dismiss this in a completely unhelpful way. Adding 2D Text is much easier than texturing it on a plane, especially if's dynamic.
Quote: "Different screen sizes And shapes see it in different places.
--- RELATIVE POSITIONS FTW! relative to screen!"
Exactly, just felt it was the more difficult option.
Quote: "Screws up when Field Of View changes or is set at an extreme value.
--- You can make a simple shader to set vertices position within screenspace. Or just internally using vertex lock but that's not cool. Also in post below dude said about set object fov()"
This is an interesting idea, but unrealistic for many people due to difficulty. set object fov() seems very helpful however.
Quote: "Can interfere with render passes and effects.
--- Lie. Hide object."
Why are you calling me a liar? This is true. You can't use Hide Object where a single SYNC is being used and only some cameras need it hidden. You possibly could, ignoring issue of difficulty, rewrite said shader to accommodate this. But even without cherry picking a scenario, the statement is in fact true. It's not meant to be an impossible problem. And I think you aren't being very polite to someone who is just trying to lend a hand. I'd like an apology please.
Quote: "2D overlay elements require more work to position accurately.
--- Why do you want to combine 2D hud and 3D hud? Pointless."
Perhaps you need to add some text that isn't pre-arranged, like a players name, or a message. Sure there's a way to get that onto a textured plane, but it's a pain in the butt compared to simply using text commands.
Quote: "Can't easily add 3D overlays like map markers.
--- Lie. Paint everything you need it IN MEMBLOCK. Plus shader overlay effects."
You have called me a liar again. Why are you dumping on people trying to help? Memblocks/Shaders are an interesting idea, but using a Memblock isn't generally regarded as easy and it's slow. Shader overlay effects require knowledge of using shaders at best and ability to write shaders at worst. I'm considering difficulty and not just possibility, with the advice I was giving. I was thinking like Fallout was above about using relative co-ords to position planes. Although shader effects could probably look nice.
Quote: "People usually can't make the map completely 3D and resort to mixing 2D and 3D.
--- Talkin'bout yourself?"
Are you trying to insult me? Why?
Quote: "You can set Texture Co-ords instead of using Get Image.
--- Memblock"
Slow.
Quote: "Easy to position and scale.
--- Scale is distorted and ugly.
You can rotate the hud easily.
--- Rotation is distorted and ugly."
Valid points. Depending on what you are doing the effects of these may not be acceptable. That's okay.
Quote: "Easy to accommodate different screen sizes and shapes.
--- Lie. You must stretch your hud if 5:4 changes to 16:9"
This is the third time you called me a liar. You don't need to stretch the hud if you properly match the Aspect Ratio to the Resolution. You might scale the hud uniformly to prevent it from being too big or small depending on resolution.
Quote: "Doesn't interfere with shaders and rendering.
--- So what? 3d hud too!"
You have to take extra steps to handle the 3D hud. It's not an impossible situation. You could cherry pick some awful situations. This is only listed as negative aspect.
Quote: "Not affected by camera field of view.
--- But affected with stretching and rotating ugly artifacts."
My original statement stands. But you make some valid points.
Quote: "I'll say this: rotating and scaling artifacts are ugly as piece of monkey cheese."
Perfectly valid opinion. If bad artifacts are appearing then a 3D Hud might be the better option.
Quote: "Quote: "This is a bit extreme but imagine what would happen. A 2D mini-map would not be affected by this. A 3D or a 3D+2D minimap would be ruined."
That is impossible - DBP camera can't do more than 180."
I think you missed the point of this statement with your response. The intention was to display a more extreme example of Field of View and to some extent other skewing effects I mentioned. There is no expectation that that scene could literally be rendered in DBPRO.
mrHandy your entire post comes off as being a bit condescending and insulting. I hope this was not your intention, especially since you mention becoming a Mod in one of your posts.
So I hope when you all see what I wrote here and above it's from a perspective of favoring less difficulty and less complexity. If your result looks really bad, you should chose another method.
This post started with the OP using GET IMAGE. And I was like oh use sprite texture co-ords to scroll the map. That was my original reason for saying don't go 3D. Then a couple people came and said nope no 2D. I thought ok you can scroll the map using UV Data. However I thought about the problems that would develop using either 3D or 2D or both. A big issue centers around running the program on more than one computer. It's just better to promote the easier solution, and mention any harder or fancier one. Despite the many interesting ideas and valid points, I don't see much of anyone talking about or paying attention to complexity or difficulty.
I didn't think I was talking to the shader writing crowd so to speak. I don't mean that in any derogatory way. I just prioritized the easier solution.
Using a 2D or 3D Hud isn't wrong by any means.
If putting this sort of thought into the kinds of suggestions I am giving is unwelcome then I probably shouldn't be posting here. Especially when I get a rebuttal on the exceedingly low level of mrHandy.