GLBasic forum

Main forum => GLBasic - en => Topic started by: SnooPI on 2020-Jul-29

Title: 3D and GLB
Post by: SnooPI on 2020-Jul-29
I see that a lot of people are more and more interested in 3D on this forum.
Maybe I and others could make a bunch of new 3D routines in tutorial format to help beginners.
I don't have a lot of time right now but if there is demand ...  ;)

If 3D pros are interested, we could set it up.
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Jul-29
I'm just clarifying one thing, the basic functions of GLB in 3D are rudimentary.

For example, you will never be able to create a real 3D sound engine.
For example, you will never be able to do a real lightmapping.
Etc ..

It lacks basic functions in GLB for this.
For that you will have to use the (strong) INLINE function and so, your program will probably no longer be cross-platform.
This is an important detail for many, I think.
Title: Re: 3D and GLB
Post by: erico on 2020-Jul-30
It could be.

I have done very little with GLB in 3d but it is within my plans to do so, in my case, all that it currently offers are more than enough.
My plan is for retro games using it, no shaders or fancy stuff, 3d rendered to 320x240.

Timewise, I´m sure I can give a bit of a hand on whatever is needed.
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Jul-30
You are welcome Erico.

Yes it can be nice a retro 3D pixelated game and indeed for that the basic functions of GLB are sufficient.

We could use this as a basis for the tutorial, it would be a 3D mini-game with well commented code that we will improve as the tutorial progresses.
I had also thought of Gernot's game as a basis : (The Legend of) Teader  ;)

Title: Re: 3D and GLB
Post by: erico on 2020-Jul-30
It could be, there is already a layout to base stuff on but it seems to be a little big game with lot´s details and stories, etc.
What about more easy stuff? Like twisted remakes of simple arcade games within different genres?
 
Title: Re: 3D and GLB
Post by: Schranz0r on 2020-Jul-31
It's hard to compete against other languages in 3D.
GLBasic with it's routines in 3D are not worth to use for me.
If i do 3D, i use OpenGL and C++ Inline.

From that point could a user say: Why using GLBasic for that and not C++ and OpenGL in VS...


Two ways to go, i would say:
1. Renew 3D in GLB from ground up.
2. Give a dang, leave it as is and drop future support.

Title: Re: 3D and GLB
Post by: erico on 2020-Jul-31
It sure won´t compete directly with the likes of modern 3d engines, but I enjoy having simple 3d support, otherwise I would have to go about creating my own inside GLB since I can't C++.
It is quick for visualization and I think quite possible to create ELITE type games, flat polygons maybe even line polygons, racers, etc.
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Jul-31
SchranzOr, me too now I mostly use GLB when I code in C++  :)  (that's also why I don't really like using the Steam version)

I don't fully agree with both of you that GLB cannot compete with modern 3D engines.
With the INLINE function, GLB has no real limit.

Going back to the tutorial... Erico, your idea of ​​making a twisted classic arcade game is a good one.
In fact, I was thinking of doing tutorials 1, 2, 3, etc ... which each time tackle different and more and more complex subjects (using for each new tutorial the things learned in the previous tutorial) then at the end make a game with these tutorials as a basis.

In the next few days I will start by making a Topic in "3D-snippets" with 1 or 2 tutorials that I would put in a .ZIP and everyone can add their tutorial.
The moderators can even add them directly to the .ZIP or even modify them if they are incomplete, buggy or poorly commented.

I don't know if I am very clear but I hope everyone understood me  ;)
If you agree, we do it like this.
Title: Re: 3D and GLB
Post by: erico on 2020-Jul-31
Yep, I´m fine with the idea.

...I don't fully agree with both of you that GLB cannot compete with modern 3D engines.
With the INLINE function, GLB has no real limit...

I meant the standard 3d stuff, not the inline.
It might be a bit hard to create tutorials with little complete games in a sense they evolve, like you learn one to do the next.
Title: Re: 3D and GLB
Post by: Qedo on 2020-Jul-31
@SnooPI
online also works on the Steam version or are there bugs that I don't know about?
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Jul-31
It might be a bit hard to create tutorials with little complete games in a sense they evolve, like you learn one to do the next.
I don't quite understand what you mean Erico  O_O
In these tutorials, we will first discuss the basics of 3D (camera, camera movement, light, display of 3D objects, etc ...) these tutorials are first for beginners so they must start with the basics.
We will not be making a game in each tutorial, it will be at the end that we will make a game based on all these tutorials.

Otherwise it's cool that you like the idea in general  :good:
I think it will help a lot of people in 3D (the new ones but also the old ones with the more advanced tutorials).

Qedo no, no, there is no problem with the INLINE function in GLB 16, it's just a problem we had discussed in the bonus section some time ago  ;)
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Aug-01
I just thought of something:

Should we use Gernot's 3D entity system (T3DEntity) for the tutorials?

This is an important choice because it will then also be used for the final game.
Personally I think it would be a good idea but I'm not sure, so I'd like to know your view,
Title: Re: 3D and GLB
Post by: erico on 2020-Aug-01
Oh now I understand you better.
What I meant was, say, the very fundamentals could lead to a PONG 3d game, but in a shufflepuck cafe styled way, then more tutorials could lead to a top down viewed game, like frogger, then more tutorial could lead to an asteroid s kind of stuff. That is what I mean, every few 3d command explanations could lead to an example game. If this all could be in videos, the better, but I know that is more work.
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Aug-01
The problem with the tutorials only as a mini-game is that it will be less clear to beginners because there will be a lot of code in each tutorial.
Moreover, a simple 3D game already covers some quite complex functions (like collisions and collision responses etc.) not just the basics.

Another advantage of doing this in the form of normal tutorials is that anyone can add their own tutorial without having to make a full game.

Nevertheless your idea is interesting, but in this case these mini-games will have to be developed in parallel with the normal tutorials and therefore it will require more work (especially if it has to be done with videos).

Otherwise, you think it's a good idea to use T3DEntity?
Title: Re: 3D and GLB
Post by: erico on 2020-Aug-01
I´d think it is, is it cross compatible?
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Aug-01
Yes, and it could be interesting for the 3D game (or several because I like your idea of ​​making a Pong and a Frogger in 3D  :)).

-EDIT-
In addition, it will help to better understand how to use this very good library.
Title: Re: 3D and GLB
Post by: Qedo on 2020-Aug-01
to be "cross compatible" you must don't use X_SETSHADER (https://www.glbasic.com/forum/index.php?topic=8211.msg69409#msg69409) for OpenglES (Android). for the rest it seems all right. Then you will need to test on Android and Html5 and there I see it hard
Title: Re: 3D and GLB
Post by: SnooPI on 2020-Aug-02
You are right.
This is an important detail.

For Android, I would not do the tests myself because I am no longer developing for this platform at the moment.
Title: Re: 3D and GLB
Post by: dreamerman on 2020-Aug-12
I'm not expert in 3d are of GLB, I mostly use it with 2d, but basic 3d in few situations are useful, if I would need to use advanced 3d and need to use Inline or something to achieve that it would be just more straight to use other tool that has needed features.

For tutorials You should use only pure GLB code (at least at start), to show all features and just to explain all concepts, for beginners using inline may be confusing in my opinion. But as addition in more advanced tutorials will give wiser possibilities.

eh.. I forgot that X_SetShader doesn't work on Android :>
Title: Re: 3D and GLB
Post by: Hemlos on 2020-Aug-23
3d sound can easily be emulated.
As any 3d sound system uses vector comparisons, GLB can too.
Using vector comparisons, you can change the volume for forward-rear, and use the balance left-right.
PS. don't forget the distance dimension heh.

PPS.
I'm a hardcore Planetside 2 player, i appreciate great 3d sound performance and depend on it to get my points. And as a programmer, i can hear and see the flaws in the "true 3d sound" environment.

What most people consider amazing 3d sound, can be improved upon GREATLY in GLB using TYPE classes.
One major improvement would be to have sound calculated and changed according to objects and structures in the 3d environment. .......Like when you go into a place that might be sealed or block, so that sound isnt calculated as it it were produced 2 meters away, when it should be muffled or NULL.

IMO "true 3d sound" is a myth, and an over glorified lib. And with the features already implemented into GLB, you can easily create a small lib, for a sound entity that will sound far better than any so called "true 3d sound" environment.


Title: Re: 3D and GLB
Post by: SnooPI on 2020-Aug-24
Not really Hemlos.
You can make a system close to a real 3d sound system but it will not be complete.
To simulate a real 3D sound environment, a function like MUSICVOLUME is missing.
A function that allows you to change the sound in real time is essential (SOUNDVOLUME?)

For example you have a radio in a room, the sound of this radio must increase or decrease in real time depending on whether the player is approaching or not.

Without a SOUNDVOLUME function, you will be able to give the illusion of a real 3D sound environment with short sounds, but if a sound is long, there will be a problem.