GLSL + FBO experiment (crystal balls)

BlitzMax Forums/OpenGL Module/GLSL + FBO experiment (crystal balls)

Taron(Posted 2010) [#1]
Alright, so here's my FBO test to see where this kind of routine works and where not as well as what we can do about it.

Nvidia and ATI seem to be biting each other in openGL, but I might just do things mildly wrong and ATI is simply more sensitive to that.

Anyway, here are a few crystal balls (well, arbitrary refraction, really) on a background that is rendered into an FBO first and then drawn and given to the GLSL shaders of the balls.



...or like this (pfff, I'm goofing around! THE KILT!)



beanage(Posted 2010) [#2]
Uh, am I missing something? Are there Images to copy? A quick test leaves me to this:

Though I am currently on my mobile system, hardware should be more than appropriate, and i GOT latest NV drivers... mmmh It's 00:45 here, maybe i'll add shader log printing tomorrow [lets say T+10h, ok?], but for T+0 thats enough :)


beanage(Posted 2010) [#3]
#version XXX
might be missing on top of your shader code.. GN8


Taron(Posted 2010) [#4]
Ah, curious! Oh my god I so hope we'll actually figure this out! :D
I don't know what you mean by #version XXX, though. I'm already excited about tomorrow!

It should look like this....


- it creates an FBO
- then draws the background checkers into it.
- then draws the FBO texture as background Quad
- then draws the balls with normal map in texture0 and FBO in texture1
(the fragment shader uses the normals to do lighting and reads the FBO through refracted coordinates!)

Thanks for checking into it, it means tremendously much to me!

As I was waiting for feedback I had some fun with it already and wrote a pong game. I've never written that and am just amazed how super primitiv this can be. I made it a little fancier, but it still fits in a jpg header, hahahaha. Wonderful fun and kind of crazy...

(title) AWESOME GLASS PONG DUDE



beanage(Posted 2010) [#5]
This finally works platform-indept.:
Added:
- "#version 120~r~n"+.. to frag as vert
- some equally named varyings had different types! (vec2 <> vec3)
- shader log printing



Taron(Posted 2010) [#6]
Doesn't work here.
Plus, for some reason the "codebox" in your post doesn't work? Bizarre...

It can't handle the "version" command or whatever it is? (unsupported version, it says in your log printing)
Can you make another screenshot and post it?
I'm very scared of the possiblity that this would work anywhere else, to be honest. Something would be utterly wrong with my install or my system altogether, hehe.

I know, you've been already diving into it so wonderfully, I'm really grateful. By all means I want you to know how much I appreciate what you're doing! My reaction could sound a little funny, but it just shows my frowning forehead, hehe. Behind it is pure gratitude along side the confusion. :}

(oops! - section...)
- oh dear, vec2/vec3 mixups, sorry about those.

(really? - section...)
- ~r~n are hopefully not necessary!?


SLotman(Posted 2010) [#7]
No go here too.
The debug output showed this:

Vertex shader was successfully compiled to run on hardware.
Fragment shader was successfully compiled to run on hardware.
Fragment shader(s) linked, vertex shader(s) linked. 


But all I got was the window, and it's content was *empty*!
I'm here on a ATI Mobility Radeon X1300, Win XP.


Samichan(Posted 2010) [#8]
BeAnAge's code in post #5 works fine here.


Taron(Posted 2010) [#9]
And...uhm....openGL still exists? I'm kind of fascinated with that. And I'm inches away from giving up, honestly. Does anyone have anything to instill some hope for a middleground that works on Nvidia, ATI and Intel alike?

Oh, does it work for you without the "#version..." line?

I feel as if somebody was watching all this and grinning his head off, having the solution but too much fun watching us squirm. Well, please, have some mercy and give us a hint.

Aside from all that, why must one become such an expert before anything starts working on more than one machine. I find that very anti-evolution, devolutionary, so to say.

However, THANK YOU for checking into this, SLotman and Samichan! Can't wait for all of us to enjoy the same fun, no matter which monster computer we have. (OH how I long for the Amiga simplicity...pffff)


Floyd(Posted 2010) [#10]
Plus, for some reason the "codebox" in your post doesn't work?

That's because he tried to use a "codeox". It's fixed now.


Taron(Posted 2010) [#11]
Uh, thanks, Floyd! Can you fix the openGL issues, too?!? :}}}
Never mind, just kidding...

Doesn't surprise me much that I've missed that, looking at the sloppy mistakes I do in my code. Although, it ain't all that bad....

Thanks again!


dmaz(Posted 2010) [#12]
I see exactly the same thing as BeAnAge and his mod then does work correctly on my system.


dmaz(Posted 2010) [#13]
btw, has anybody tested either version intel gfx, which works there?


Taron(Posted 2010) [#14]
the first shaderline
"#version 120...
doesn't work for my system!

If you take it out, will it still work for you?

like so...



beanage(Posted 2010) [#15]
If you take it out, will it still work for you?

Yup, great, it does! Oh and thanks for fixing that typo for me, Floyd :)

I would not expect that shader stugff to work flawlessly anywhere.. see I got OpenGL 3.2 installed, but, assuming you are currently on your apple device (OOOOh 8 cores you got no idea of how jealous I am), you got OpenGL 2.1 (Crappy OSX driver issues, Leadwerks had the same problem, but it seems being fixed as I'm making typos here), which means... something even below GLSL 1.2?! Wow...


Taron(Posted 2010) [#16]
OMG...does this work for you then, too?
AwesomeGlassPongDude (99kb)

That would be such a joy!
(I'm so nervous!)


dmaz(Posted 2010) [#17]
like so...
yes, this works for me....

OMG...does this work for you then, too?
nope


beanage(Posted 2010) [#18]
Awesome Glass Pog Dude works for me either! Great! It's OpenGL all over again!


Taron(Posted 2010) [#19]
Ugh, now I'm confused again.

dmaz - Pong doesn't work on your machine? (sure it's not an openAL issue?)
BeAnAge - Pong works on yours?

I was asking for hope, I've got hope again! :}
Great start for a day, that's for sure...my mission now: Making it work on dmaz' system!


_JIM(Posted 2010) [#20]
Taron, your code from #14 works here (XP SP3, GeForce 8800GS). I'll try it when I get home on ATI and if there's issues I'll see if I can fix 'em.

Also, this is VERY interesting :) Too bad FBOs and shaders aren't supported on stone-age GPUs :(


Taron(Posted 2010) [#21]
Thanks, Andrei!
Have you tried the Pong game (#16)?


_JIM(Posted 2010) [#22]
I did now. I can confirm it's awesome :)


Taron(Posted 2010) [#23]
:} HAHAHA! THANKS! :)))


dmaz(Posted 2010) [#24]
the code from #14 works on my system... pong runs and there is sound but I get a yellow background with a green sphere in the middle.


Taron(Posted 2010) [#25]
AH, that means that I'm doing something iffi with the GLSL shaders on it. Let's see if I can track it down...

Does this work for you...



_JIM(Posted 2010) [#26]
I finally had time to actually power up my home PC. All of this works (#14, glass pong and #25) without any problem.


Taron(Posted 2010) [#27]
SWEEEET! Oh my...hope...there's hope...lemony fresh hope!
Alright, I'm very scared to hear what dabz has to report, but also can't wait...grrr. :}}}
(I know, one of these days I'll shake my lowered head in memory of this difficult birth, jeeez.)

I have a hunch that ATI really has no tolerance for writing a vec4 variable into a vec3. Nvidia eats it up with no complains, knowing that it can only mean 3 floats are wanted. ATI says:"I don't care if you can't program, shit's not gonna run...basta!". LOL. Thanks... :P

Eitherway: THANK YOU, Andrei, you're making me very happy and are helping me so much the whole way! I really hope I can make you feel some pride with what I slowly become able to put together.


Samichan(Posted 2010) [#28]
"AwesomeGlassPongDude (99kb)" in post #16 did not work for me, shows "openAL ready..." and freezes. Code in #25 worked fine.
GTX295 + Win7 x64


Taron(Posted 2010) [#29]
Sounds rather like an openAL problem, actually. OpenGL really becomes tighter after the background creations. BUT, OMG, #25 works for you on an INTEL?!? WOW! That's one heck of a beautiful "good morning" present to me! Thank you! :)

To be sure I will later compile a version without sound. The last thing I need is more confusion for all of us, hehe.


Taron(Posted 2010) [#30]
AwesomeGlassPongDude_noAudio.rar

There! Hopefully that does it?!


_JIM(Posted 2010) [#31]

BUT, OMG, #25 works for you on an INTEL?!?



I don't see any mention of Intel GPUs. GTX295 is actually very high-end nVidia if that's what got you confused :)


Taron(Posted 2010) [#32]
OH...nevermind... i saw the name Intel and my hope got the best of me... LOL. Thanks for bringing me back down to reality! :oP ...haha.

I've uploaded a new version with audio, too. So much fun making sound effects!


Samichan(Posted 2010) [#33]
AwesomeGlassPongDude_noAudio.rar works and looks like this, needs some more awesomeglass imo.
Every other openAL app has ran fine on this machine.


Taron(Posted 2010) [#34]
YAY! That's great already...more glass to come! There's already a goody box appearing, but it'll get more, I believe...haha!

Man, I'm so tired of all the "open" things already, pffff. It's the first report I know of, that the openAL I've implemented has troubles. I think it's leadwerk's "TSource" Type I'm using, if that was him making it?! Felt like a good start and worked well so far. It may not be that which causes the problems... tough to track down, I'm afraid.

Can you download AwesomeGlassPongDude.rar again and try now. It shows the generation of the sounds and might help find where it fails! Maybe it's not even openAL...


Samichan(Posted 2010) [#35]
AwesomeGlassPongDude.rar version in post #34 works 100%!

At first I thought it froze again at "openAL ready...generating sounds", but this time around I didn't have loud music playing and I actually heard my hard-drives spinning up and waited for them. After 10 seconds the app continued happily.
No idea why your app would want to spin up my hard-drives, my OS is on an SSD and it's always "spinning".
The app was in my firefox downloads folder which is on my SSD.
The first version might have worked too if I would have known to wait for the hard-drives.


Taron(Posted 2010) [#36]
AH......sweet! Thank god!
Well, not sure why it does, but it might have something to do with memory, since I'm allocating a fair amount for the sounds. Maybe it's pagefile gets some extra...hehe. Not sure, though.

Eitherway... IT WORKS, YAAHEEHAAA! (the joy!)

Thanks for checking again, Samichan!


dmaz(Posted 2010) [#37]
#25 and #34 finally work for me as well! looks great!


Taron(Posted 2010) [#38]
<sigh> ...I'm so happy and tired. This will be a brilliant good night sleep. Thanks, dmaz! New version is up, too... hit space to get rid of the logo!


nawi(Posted 2010) [#39]
Pong works pretty good under GNU/Linux with wine too. And so does the crystal balls.


Taron(Posted 2010) [#40]
Ah, excellent! Thanks, nawi! ...now I just gotta get my "SirPenta" to work. :P