Posts: 217
Threads: 32
Joined: Apr 2022
Reputation:
69
I must admit, Unseen Machine has shown me a new world! Although I haven't spent much time on programming in the past, Unseen Machine's OpenGL solutions inspired me and I got immersed in understanding things again. Basically, the fact that saving memory operations speeds up rendering has always eluded me. _maptriangle is incapable of doing this. Opengl too, if not optimized. I delved into OPENGL about a year ago, but I ignored the concepts of "VBO", "opengl list". Therefore, the fps was quite limited, and the computer (or android) worked a lot. Some programs were born for windows and android, which meet the expectations, but WITH A LOT OF ENERGY! I limited them, and with restrictions.
Now several topics, forums, and threads have started regarding opengl. I feel like many people would like to have Unseen Macine's knowledge. He is a great help in the direction of opengl. I would like to answer here. Unseen Machine helped me and rewrote 'openworld2' to be efficient. The processing and rendering became faster, but for some reason the number of triangles that can be displayed remained limited. If there are too many triangles, then the rendering is incorrect. This problem remains. However, the FPS has increased a lot! I don't understand why.
I'm experimenting with a maze generator. It basically creates blocks. It outputs all 3d data to an .OBJ file. I can check this with online 3d viewers and blender. I rewrote the ASHIS obj renderer that Unseen Machine showed me. It's perfect for this purpose.
Currently, I want to show how opengl can work efficiently. It doesn't have walking yet, but it can navigate in 'fly' mode and has wall detection. The light source moves around.
I want to finish this program. I'll write the 'walk' (and enjoy) mode. In order to force the user to solve the task.
Download to : opengl gigant, WASD control, maze enjoy
Posts: 2,910
Threads: 305
Joined: Apr 2022
Reputation:
167
I feel like I'm in the Matrix. Oh wait, that's right, I am!
Pete
Posts: 349
Threads: 45
Joined: Jun 2024
Reputation:
32
Awesome work dude! +1 from me!
Keep it coming and the stairs are particularly impressive...thats not easy to do!
Unseen
Posts: 217
Threads: 32
Joined: Apr 2022
Reputation:
69
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.
Posts: 349
Threads: 45
Joined: Jun 2024
Reputation:
32
So,
Turn Lighting off, what you see then is what youd see with lighting at full brightness, no colour, diffusion etc...if you want a pixel to appear brighter than its original texture then it has to be less than max...otherwise bleaching happens...think if you shine a really bright torch on a surface, colours, depth and texture etc are all "whited out" (bleached). So if you want brighter colours based on a light interaction...that colour cant be more if its already maxed out...
As for reflections, we can apparently do it with our Qb64 GL limited 1.1 pipeline, but i have yet to make an example work!
Crack on! Im glad you learnt the lists technique too...and thanks for the glowing appraisals!
unseen
Posts: 361
Threads: 36
Joined: Mar 2023
Reputation:
28
I'd love to try this out, but I guess it's Windows only? When I try to compile the program on my Mac it just crashes. The video looks great though, MasterGy!
Posts: 217
Threads: 32
Joined: Apr 2022
Reputation:
69
If anyone is an expert in what Mac doesn't like, please describe it to me. I'd be happy to rewrite it to run on it. Openworld2 didn't run for NakedApe either. Is that true? It won't start? or the controls don't work?
Posts: 361
Threads: 36
Joined: Mar 2023
Reputation:
28
That's right. Neither of them works in MacOS. OpenWorld2 compiles quickly, but won't run. Maybe poor, over-worked Sam could take a look when he gets a chance? @a740g
Posts: 520
Threads: 65
Joined: May 2022
Reputation:
86
11-02-2025, 10:32 AM
(This post was last modified: 11-02-2025, 11:29 AM by Petr.)
Wrong reply before. Works Ashish's Obj Viewer in MacOS?
@MasterGy I really like your game, it's very nicely done. Thank you for sharing!
Posts: 487
Threads: 24
Joined: May 2022
Reputation:
91
@NakedApe
Over-worked - yep, that's me.
In both programs, find and change the
Code: (Select All)
SCREEN _NEWIMAGE(_DESKTOPWIDTH / 2, _DESKTOPHEIGHT / 2, 32)
line to
Code: (Select All)
SCREEN _NEWIMAGE(1600, 900, 32)
Tweak the resolution for your display.
I think it may be an issue with the _DESKTOP* functions. I have a feeling that those get usable values a little late compared to other platforms. I'll dig deeper when I get some time.
@MasterGy This is a kickass demo. Well done! But please add a way to exit the program. I had a hard time doing that with the app running full screen on my Mac. There may be a way, but I am a Mac noob.
|