Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minecraft Clone with OpenGL
#31
(08-06-2024, 11:24 AM)SpriggsySpriggs Wrote: I'll give those a try today. QB64 does support OpenGL on my system. I'm running Windows 11 64 bit with an RTX GPU and Intel processor. This is probably the only OpenGL program I've had issues with. I don't think OpenGL is the cause of the issue.

Probably a bit late...

It freezes if you have C++ optimizations enabled. I'll look into it when I get some time.
Reply
#32
Ran it again with C++ optimization disabled and it works! It looks amazing! Excellent work!
The noticing will continue
Reply
#33
Good to see that you are finally enjoying it  Smile
Reply
#34
I appreciate these Minecraft clone posts on both forums to get over a 1k views, thanks a lot.
A few people know that I started college this year, so I don't get time to work on these cool projects. And when I get time, I just don't feel like it...
I want to apologize the pre-announcement of QB Blocks 4, but it's a lot buggy, and coding a whole new would take a lot of time as I haven't touched this project for months,
I am working very less on this project, but I need motivation, time and a few ideas from your side.
You all can give me ideas from trees, terrain, biomes, new dimensions, multiplayer (I don't think it would be easy though) to the base optimizations and UI, that would help me a lot.
I love coding this project, but the time I put in this made me bored.
I will try to put some time on this project, and will try to upload a 'QB Blocks 4 Beta 1.0' release up on the github page
Thank you again for over 1k views.
Reply
#35
Glad you finally hosted it on GitHub. Nice work on the project so far BTW.
Reply
#36
Check it on QB Blocks 4 on Github

New Massive Performance Update

Working on QB Blocks 3 Code, so FPS Counter works now
Max Chunk Loading Time: 1040 ms (MAX) -> 60 ms (MAX)
Average Chunk Loading Time: 150 ms -> 6 ms

You can increase the max render distance if you have a pc with more than 8gb ram

New Cool GUI

It may hang on the 'QB Blocks' screen or 'Generating Chunks' screen, just restart the program
It may not work if you have advanced c++ optimizations enabled

Fixed Trees Breaking

Pls, help
    If someone knows how can I add lighting with normals
    If someone knows how to sort for translucent objects
Reply
#37
GL is out of my league, a740g maybe? Ashish might if he were here.

I don't know if MasterGy uses GL either.

Oh AP you know FreeBASIC!
b = b + ...
Reply
#38
Hi!

At first I thought I would describe in detail how to do it. But even though I found theoretical material and chatgpt also helped me understand lighting half a year ago, it still took me a long time to apply it. Fortunately, this went quickly.That's why I thought I'd better incorporate it into your code. After all, you can find theoretical material on the net, but at least it works this way and you can expand it and experiment.

I didn't delete anything from your code.
Changes:

In addition to the correct direction of the normals, the order of the vertices is very important. You used 'gl_quads' in drawarrays. This is not good, because the 2 triangles made from 4 points will be in opposite directions. That's why I drew your long array not all at once, but in quads, with 'triangles_fan'.
In the 'cube' vertex file, the order of the vertices had to be changed somewhere to make them look good.

You need as many normals as there are vertices. A normal array is also generated in parallel with the vertex array. At the beginning of the program, it calculates the normals when reading the cube vertices.

You will see it in the rendering section under 'light'. I set 1 directional light. The direction of the light is the direction of your sun and moon. I think I set it correctly, from where the sun shines, it casts light and shadow on the entire path.

There are many options in OpenGL to make it run faster. It should be more optimized. For example, drawelements and the use of vertex indexes. You can also see that 1 vertex occurs multiple times. It calculates the same vertex over and over again exactly 8 times. Using drawelements, it is possible to calculate 1 point only once.
CULLFACE . I put it in, but I'm not sure if I put it in correctly. Knowing the normals, the renderer can determine which plane shapes have their backs. This is useful for closed and non-transparent textured geometric shapes, because it doesn't draw what has its backs. A cube is the best example. It's impossible to look at a cube and see more than 3 sides at once. That's why it doesn't draw the 'back' three. Cullface only works if there are normals, because it can decide based on that who is facing which direction.

By the way, I really like your code, because it's nice and tidy and transparent. I can't see into everyone's code like that, but yours is very easy to understand.
The game is great, I'm curious about further development!

https://drive.google.com/file/d/1j7cVpK4...sp=sharing
[Image: lighting.jpg]
Reply
#39
MasterGy is a friggin' legend, man
The noticing will continue
Reply
#40
I think you are right! We need AP to confirm but I suspect he will, stay tuned...
b = b + ...
Reply




Users browsing this thread: 3 Guest(s)