Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minecraft Clone with OpenGL
#41
Hello, MasterGy
This is actually pretty good...

Firstly, I got the right way to deal with the normals, previously I was trying to store 1 normal vector for each face. Thanks for this
Then, I moved the normals (after printing it on the $console) to the 'cube' file
and I restructured the calculation of the _GL_LIGHT0 -> _GL_POSITION
Lastly, I experimented to work it with quads (because they are easier to handle for me)
Will release it the next week probably, cause I am on my old pc without all my projects...

The only thing is that the other faces after nearly black, isn't there a threshold so we could see them?


Well, I have to restructure it a lot, so it may get a bit more tidy   Big Grin
Thanks for the help  Smile
And this game (not even a game yet), has a big history of contribution from many people, else it would just be a qb64 dream...
Reply
#42
I'm glad you like it and that I had a little fun with it! Smile

Am I understanding the question correctly? Shouldn't the lighting be too dark? You can set it here:

Code: (Select All)
 Dim lcolor(2) As _Float
            lcolor(0) = 1
            lcolor(1) = .8
            lcolor(2) = .8
            power = .2: _glLightfv _GL_LIGHT0, _GL_AMBIENT, glVec4(lcolor(0) * power, lcolor(1) * power, lcolor(2) * power, 1)
            power = .8: _glLightfv _GL_LIGHT0, _GL_DIFFUSE, glVec4(lcolor(0) * power, lcolor(1) * power, lcolor(2) * power, 1)
            power = 5: _glLightfv _GL_LIGHT0, _GL_SPECULAR, glVec4(lcolor(0) * power, lcolor(1) * power, lcolor(2) * power, 1)

'lcolor' is the lighting color. (RGBA ,0-1 scale) Currently it's a very light pink.1,.8,.8.

This will actually act as a multiplier when coloring the pixels, which will work according to the following 3 settings.
ambient, diffuse,specular

It's well described here:
https://learnopengl.com/Lighting/Basic-Lighting

I intentionally brought it out in the code with the 'power' variable so that the color stays the same for everyone and can be easily calibrated. Ambient is the ambient light. If you set this higher, it won't be as dark as the one that doesn't get any light.
Reply
#43
just 1 thought: FOG_COLOR = SKYCOLOR ? I tried it, and I think it's very good. At any time of day, the landscape is colored with the color of the sky. and in the far distance the cubes blend into the sky, the sudden boundary line disappears.
Reply
#44
Updated Github
Your idea about FOG COLOR = SKYCOLOR is perfect and it looks much better than the white colour.
Added Lighting in this version
And improved the memory performance by combining normal and transparent blocks in the same array.

Btw, this thread just hit 2k views
Reply
#45
Uploaded to Github as a pre-release

Added cool Info Menu, which does not hide when game is paused
Fixed bugs with Saving & Loading worlds
So, now it's nearly a game to play with

I scrapped the GL_LIGHTING idea, it was hard to deal with, and I couldn't find any correct colours for ambient, diffuse and specular values
I would also need to understand it more to implement lighting in the game

Overall, this game is pretty good for now...
So, I will build up the list of ideas until next pre-release QB Blocks 4 Beta 3

Tell me how is it Big Grin
Any ideas or improvements are appreciated Smile

Btw, can someone give some ideas for biome & terrain generation?
Reply




Users browsing this thread: 2 Guest(s)