Holy monkey,
this might the most impressive demo here up to date!
Petr
Hello community,
I'd like to submit this TBGL+GLSL project as my contribution to thinBasic's code base. It isn't particularly Christmas-looking but I'm absolutely sure many of you will have quite a few pleasant moments flying through this beautiful oasis of stunning shapes and amazing colors.
Despite its limited features, Fraxter3D Demo runs perfectly well for me and I hope it will run OK on your platforms too:
This demo's big brother Fraxter3D Full can be found on the FBSL forum. It comes in a zip with full sources, compiled executable, and a bunch of loadable shaders for everyone to enjoy:
Merry Christmas and a happy New Year, friends!
Mike
(3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)
Holy monkey,
this might the most impressive demo here up to date!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Thanks gentlemen,
It was my pleasure to share it with the thinBasic community. Do not hesitate to load the FBSL version too even if it's written in another language. The syntax isn't much different so that somebody may eventually go as far as extending the demo to a complete port. I don't have time enough to do it myself unfortunately though I'm planning to go on working on this project some time in the future if my time schedule permits.
Mike
(3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)
Dear Mike,
thanks so much for this astonishing script. It goes so far from my imagination of possible scripts made with thinBasic.
It is so fascinating to navigate inside/in/out/up/down such beautiful math structures ... wow
I have one question: when I use arrow keys to move inside the 3D world I get a "beep" at every key pressing.
I didn't see any "beep" command inside the code and I searched all around my thinBasic development source code to see if I left some "beep" somewhere but I didn't find any.
Maybe for some reasons it can come from the graphic card ?
Ciao and thanks again
Eros
Last edited by ErosOlmi; 30-12-2013 at 10:29.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Hi Eros!,
I think the beeping is related purely to windows GUI, try to run the script below and press A,D... you will get beep. Try to press W, S - no beep.
I think Windows tries to tell the user there is not control which has &<letter> associated. Because I put &W and &s in the buttons, these keys don't beep, other letters will do.Uses "UI" ' -- ID numbers of controls Begin ControlID %cCanvas %bClose End ControlID Begin Const %MAIN_WIDTH = 320 %MAIN_HEIGHT = 240 End Const ' -- Create dialog here Function TBMain() Local hDlg As DWord Dialog New Pixels, 0, "Beep",-1,-1, %MAIN_WIDTH, %MAIN_HEIGHT, _ %WS_POPUP Or %WS_VISIBLE Or %WS_CAPTION Or %WS_SYSMENU Or %WS_MINIMIZEBOX To hDlg ' -- Place controls here Control Add Button, hDlg, %bClose, "Click to clo&se", %MAIN_WIDTH-105, %MAIN_HEIGHT-30, 100, 25 Control Add Button, hDlg, %bClose+1, "&Wow", 10, %MAIN_HEIGHT-30, 100, 25 Dialog Show Modal hDlg, Call cbDialog End Function ' -- Callback for dialog CallBack Function cbDialog() ' -- Test for messages Select Case CBMSG Case %WM_INITDIALOG ' -- Put code to be executed after dialog creation here Case %WM_COMMAND ' -- You can handle controls here Select Case CBCTL Case %bClose If CBCTLMSG = %BN_CLICKED Then Dialog End CBHNDL End If End Select Case %WM_CLOSE ' -- Put code to be executed before dialog end here End Select End Function
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Dear Eros,
Thanks a lot for your warm words of appreciation! There are very many beautiful visuals in thinBasic already so my submission will only make its existing code base just a little richer.
Yes, now that I've turned my audio gear on, I do hear these ugly beeps you mention which I've overlooked before as I usually prefer to concentrate on my work in complete silence. IMO they appear because TB's forms are Dialogs. FBSL forms are just raw windows. Dialogs have prebuilt keyboard response logic while raw windows haven't.
From this standpoint, Petr is correct in his findings. Since there isn't any control on Fraxter3D Demo's main dialog that's responsive to WASD key presses explicitly, the OS reports back with a system beep. Perhaps it might've been suppressed by putting some invisible dummy control on the main dialog that the WASD presses would sink in silently.
I'm sorry for not noticing the bug in time. If somebody else of the peers has the nerve to experiment with my code some more in order to fix it, I would only be glad and thankful but I don't have enough time personally for that at the moment.
Have a Happy New Year, Eros, and good luck with your wonderful project!
Mike
(3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)
a) the fraxter demo doesn't work here on my machine (win xp amd notebook), there's an error with "glcreateshader()", see screenshot. perhaps a fil is missing or updated tbgl version? I've downloaded last thinbasic 1.9.11.0.
b) it's not very easy to find a link to last thinbasic version at this entry thinbasic website.
bye, maurice
There is no checking for GLSL support in the example, it could be easily added by testing the handle value in GLSLInit function.
I personally prefer CG over GLSL - it has a bit better support on older cards, especially Intel based ones, which is your case, I presume.
Petr
P.S. Mike, I discovered your note about my wrong declaration of uniform. Post a bug report or send me PM next time please, I found it by accident and could easily miss it.
I just sent corrected version to Eros, fix will be present in next release.
Last edited by Petr Schreiber; 15-01-2014 at 13:44.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
@Maurice
It is my fault as I overlooked to notify the TB audience like I usually do on the FBSL forum that this is a GLSL script and it needs GLSL support and a very good video card to run satisfactorily. I also regret to say that unfortunate owners of on-board SiS video chips will probably be never able to run GLSL-based scripts on their laptops at all.
@Petr
I wasn't stressing this nuisance because it was easy to bypass. The solution didn't add noticeable overhead and the inaccurate declaration was just a nuisance rather than outstanding bug.
OTOH there is also a glitch in TBGL proper that IMHO may be regarded as an ineffective implementation of the library's key function. I'm talking about the TBGL_ShowCursor() toggle which is criticized in the main project file, Fraxter3Demo.tbasic.
Matter is, MS Windows' ShowCursor() API maintains an internal count of cursor toggles whereby the cursor may be shown or hidden only if the current number of off's is equal to the current number of on's for the entire lifetime of an application. The API is a black box except for its return value (difference between on's and off's) and cursor visibility cannot be queried directly either.
The only way to guarantee programmatically 100% that the cursor will be switched on or off at a given point in time is to implement the toggle as follows:
TBGL's cursor toggle doesn't seem to be aware of that and behaves as if it would always rely on a single call to ShowCursor(%TRUE) to pop the cursor, and on a single call to ShowCursor(%FALSE), to hide it. This is of course not correct in a general sense. If this is how the cursor toggle is actually implemented in TBGL then it is a design fault that will be causing program malfunction and therefore should be fixed as soon as possible.Sub CursorOn() While ShowCursor(%TRUE) < 0: Wend End Sub Sub CursorOff() While ShowCursor(%FALSE) >= 0: Wend End Sub
Regards,
Last edited by mike lobanovsky; 15-01-2014 at 15:42.
Mike
(3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)
Bookmarks