A little "HowTo" use OpenGL in GLBasic

Previous topic - Next topic

kanonet

Quote from: Schranz0r on 2014-Aug-18
Should i redo it to Vertex buffer object ( VBO )  ???
Ah... and the Rendering to Triangles/ Trianglestrips?
Would be interesting. And yes to triangles/trianglestips.

BTW how would you do animations?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

matchy

I have already taken out the random colors.

For the last time, can I get feedback from anyone regarding my demo because that is all I ask:
Here is the link again, in case you have dyslexia:
http://www.glbasic.com/forum/index.php?action=dlattach;topic=9962.0;attach=6817

fuzzy70

Your demo seems to work fine Matchy. Things look a bit odd if you go below the cubes as looks like faces are fighting each other to be viewed.

Other than that what feedback are you looking for?

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

matchy

Thanks fuzzy70 and you'll see the face color modifications. I think that I am not putting in the bottom face of the cubes and it's really just supposed to be land. Also, it crashes above 128x128 but I am able to get more than twice otherwise with my code.
With my "3d engine" I was able to turn off zbuffer and display only the side of the cube (wall) that is required. I did this so that is would work on Android.
So what would be interesting to have an algorithm to do just that. I mean, when creating a cube, where is the back?



fuzzy70

I'll have a look, am pretty sure I saw an algorithm somewhere that culls cube faces as if your close up you only see one side & if far away the maximum you will ever see are 3 sides.

Also personally any of the cubes that's blue I would make them share the same colour so there the same level like water should be as there not small enough to simulate waves or such but that's not the point of the demo.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

matchy

 :good:

I don't know how it could without recreating the object. In terms on block tiling, one simple way to do it is to just create a 3-sided cube then just rotate it to face the player.

Alternatively, what I wanted to original to with the demo was to have it as one object (top face) with it's slant to the next tile height, so it looks like proper terrain. :whistle:

fuzzy70

Quote from: matchy on 2014-Aug-19
Alternatively, what I wanted to original to with the demo was to have it as one object (top face) with it's slant to the next tile height, so it looks like proper terrain. :whistle:
That's just a simple plane generated from an array, pretty sure on one of the noise posts (cant remember if perlin or simplex noise) I posted a program that scrolls the noise isometric style drawn with polyvectors. That wasn't drawn from arrays but rather calculating the noise per frame so major performance hit.

Not sure if this would help but glEnable(GL_CULL_FACE) might give a boost over scanning what faces are visible or not as unlike a minecraft style display where there are cubes possibly above & below these ones are just adjacent to each other.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

matchy

I almost had terrain just commented/left out the code in the demo because it was getting late that evening.

Next test should be for Android, because that is the original reason for the idea of efficient object drawing, otherwise its shouldn't really be a concern aside from speed.

fuzzy70

Other than the quick & dirty iso one I posted using polyvectors (which was only done to show another way of viewing the noise plus added FMB to roughen it up a bit) by last exploration of landscape generation was on the Amiga in Assembly language & lookup tables lol. Basically a long while ago  :D

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Schranz0r

Quote from: kanonet on 2014-Aug-18
BTW how would you do animations?

I don't think about it...  :zzz:
should i?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

kanonet

How should I know, its your project?
IMHO if you dont use shaders, you need to build the animated object at runtime, each frame. So you could not use your display lists etc. Pr do you know a way that I dont see?
(If you use shaders you can render static objects and just animate them in shader - but I have done this myself already, so Im less interested in this)
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64