Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minecraft Clone with OpenGL
#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


Messages In This Thread
Minecraft Clone with OpenGL - by aadityap0901 - 07-19-2024, 07:21 AM
RE: Minecraft Clone with OpenGL - by MasterGy - 07-19-2024, 06:34 PM
RE: Minecraft Clone with OpenGL - by TempodiBasic - 07-19-2024, 11:27 PM
RE: Minecraft Clone with OpenGL - by NakedApe - 07-20-2024, 12:05 AM
RE: Minecraft Clone with OpenGL - by Pete - 07-20-2024, 12:22 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-20-2024, 04:47 PM
RE: Minecraft Clone with OpenGL - by grymmjack - 07-21-2024, 06:37 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-22-2024, 05:28 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-23-2024, 07:22 AM
RE: Minecraft Clone with OpenGL - by MasterGy - 07-23-2024, 05:31 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-24-2024, 04:25 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-25-2024, 11:03 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-26-2024, 05:40 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-27-2024, 08:46 AM
RE: Minecraft Clone with OpenGL - by bplus - 07-27-2024, 02:25 PM
RE: Minecraft Clone with OpenGL - by a740g - 07-27-2024, 03:31 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 07-27-2024, 05:05 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-02-2024, 09:32 AM
RE: Minecraft Clone with OpenGL - by bplus - 08-02-2024, 01:51 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-03-2024, 03:58 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-03-2024, 04:29 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-05-2024, 10:00 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-05-2024, 05:34 PM
RE: Minecraft Clone with OpenGL - by a740g - 09-19-2024, 04:12 PM
RE: Minecraft Clone with OpenGL - by bplus - 08-06-2024, 12:32 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-06-2024, 06:01 PM
RE: Minecraft Clone with OpenGL - by MasterGy - 08-06-2024, 06:11 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 08-25-2024, 10:21 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 09-23-2024, 02:46 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 12-14-2024, 01:45 PM
RE: Minecraft Clone with OpenGL - by a740g - 12-14-2024, 03:13 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 01-21-2025, 07:59 PM
RE: Minecraft Clone with OpenGL - by bplus - 01-21-2025, 11:55 PM
RE: Minecraft Clone with OpenGL - by MasterGy - 01-23-2025, 05:40 PM
RE: Minecraft Clone with OpenGL - by bplus - 01-23-2025, 07:02 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 01-24-2025, 06:07 PM
RE: Minecraft Clone with OpenGL - by MasterGy - 01-24-2025, 07:35 PM
RE: Minecraft Clone with OpenGL - by MasterGy - 01-25-2025, 07:06 PM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 01-27-2025, 09:11 AM
RE: Minecraft Clone with OpenGL - by aadityap0901 - 01-27-2025, 07:13 PM



Users browsing this thread: 5 Guest(s)