10-31-2025, 07:32 AM
Thanks Unseen Machine and Pete! 
Unseen,
I haven't dealt with the opengl part of the game that you use yet. I will have to, because it would be important to understand how it works. For now, I've rewritten Ashis' obj-renderer. It will be important to convert the program so that it doesn't suffer from reading the obj text file (which takes a lot of time), but just loads opengl with arrays from a binary file that a maze-generating program creates. That's why there is currently no sky in the game, because it can't be part of the obj.
When you showed me this obj-renderer, I jumped on it right away and rewrote it, and I skipped right past the most important part to understand how it works, and how your solution works as well. So I'll disassemble the openword2 that you rewrote later.
I experimented a lot with the light. The problem is that real sparkle can't be achieved this way. The color of a pixel is calculated by opengl in the default case as follows: texture x light x material (light is the result of the light's position/direction, and the texture's normal direction). Since the result can only be a norm (between 0 and 1), the pixel it draws can never be lighter than the original pixel of the texture. That's why the color of the light source cannot shine. I can't solve the problem that the light we use to illuminate it should be the dominant one. I want the sunlight, for example, to be a high red and green mixture, we can say yellow, light yellow. And I want that if this light is projected onto the triangle from the front, then the color of the sun can be seen on the triangle, but the color of the texture. This would be the real shimmer effect. Just like in other 3d viewers. The point is that according to chatgpt this thing is available in "opengl shader", but here, in the qb64 opengl, this function is not available.

Unseen,
I haven't dealt with the opengl part of the game that you use yet. I will have to, because it would be important to understand how it works. For now, I've rewritten Ashis' obj-renderer. It will be important to convert the program so that it doesn't suffer from reading the obj text file (which takes a lot of time), but just loads opengl with arrays from a binary file that a maze-generating program creates. That's why there is currently no sky in the game, because it can't be part of the obj.
When you showed me this obj-renderer, I jumped on it right away and rewrote it, and I skipped right past the most important part to understand how it works, and how your solution works as well. So I'll disassemble the openword2 that you rewrote later.
I experimented a lot with the light. The problem is that real sparkle can't be achieved this way. The color of a pixel is calculated by opengl in the default case as follows: texture x light x material (light is the result of the light's position/direction, and the texture's normal direction). Since the result can only be a norm (between 0 and 1), the pixel it draws can never be lighter than the original pixel of the texture. That's why the color of the light source cannot shine. I can't solve the problem that the light we use to illuminate it should be the dominant one. I want the sunlight, for example, to be a high red and green mixture, we can say yellow, light yellow. And I want that if this light is projected onto the triangle from the front, then the color of the sun can be seen on the triangle, but the color of the texture. This would be the real shimmer effect. Just like in other 3d viewers. The point is that according to chatgpt this thing is available in "opengl shader", but here, in the qb64 opengl, this function is not available.

