glsl fragment and vertex shader 4.60

Share your advanced PureBasic knowledge/code with the community.
User avatar
idle
Always Here
Always Here
Posts: 5876
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: glsl fragment and vertex shader 4.60

Post by idle »

@kuron
sorry you would have to pay me to fire up windows :lol:
but I will make an exception and can compile you a 32 bit windows version if you want!

I've updated the demo and added a few controls to the shader utilizing the method that DarkDragon mentioned, it's not ideal
but it at least means we can interact with a shader.
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: glsl fragment and vertex shader 4.60

Post by Kuron »

Don't bother on my account.

I would love to see a screenshot of the example, though.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: glsl fragment and vertex shader 4.60

Post by luis »

Kuron wrote:Is anybody willing to share a compiled Windows EXE for the example?
Here it is ... but why ? Cannot you build it ?

http://dl.dropbox.com/u/38644496/ocean.zip (source included)

Please let me know when I can delete it :wink:
Last edited by luis on Sat Nov 19, 2011 9:26 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Michael Vogel
Addict
Addict
Posts: 2799
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: glsl fragment and vertex shader 4.60

Post by Michael Vogel »

luis wrote:
Kuron wrote:Is anybody willing to share a compiled Windows EXE for the example?
Here it is ... but why ? Cannot you build it ?
Maybe, because the source isn't available for the moment :|
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: glsl fragment and vertex shader 4.60

Post by Kuron »

luis wrote: Here it is ... but why ? Cannot you build it ?

http://dl.dropbox.com/u/38644496/ocean.zip

Please let me know when I can delete it :wink:

Thank you, very much. I really appreciate it.

I currently don't have access to either of my development machines and do not have PB installed on my Internet system.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: glsl fragment and vertex shader 4.60

Post by luis »

Michael Vogel wrote: Maybe, because the source isn't available for the moment :|
Oh, sorry, I put only the exe online and since I'm not interested in using the PB 3D commands I deleted the source.
I had a voice telling me "add the exe to the source and upload it all, come on!" but I didn't listen :?

I'm sure idle will put it online again.

@kuron

No probs :)


I added the source to the zip, get it if you need it I'll remove it in a couple of days.

EDIT: removed.
Last edited by luis on Mon Nov 21, 2011 12:55 am, edited 2 times in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
idle
Always Here
Always Here
Posts: 5876
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: glsl fragment and vertex shader 4.60

Post by idle »

Michael Vogel wrote:
luis wrote:
Kuron wrote:Is anybody willing to share a compiled Windows EXE for the example?
Here it is ... but why ? Cannot you build it ?
Maybe, because the source isn't available for the moment :|
I didn't realize I had to change the link when I updated the folder.
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: glsl fragment and vertex shader 4.60

Post by Andre »

J. Baker wrote:Looks great on Mac! Just had to comment out lines 3-6 and remove the OpenGL subsystem. Nice work! ;)
I would also like to see it running on my MacOS 10.5.8 using PB4.60, but I only get a black window (windowed mode) or an empty screen (fullscreen mode)... :?
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: glsl fragment and vertex shader 4.60

Post by Danilo »

Nice example, but the PureBasic implementation of OGRE still has BIG problems.

First test some days ago just crashed your program after moving forward with the cursor key
in Fullscreen mode. Now i tested again:

The Mouse Cursor is not captured in fullscreen mode, so i can not look around.
It works in windowed mode.

I changed OpenControls() to OpenControls(1) to display the GUI. It worked!
After clicking the last UpDown Control (for ScaleV) of the GUI in fullscreen mode,
i got a bluescreen, memory dump, and PC rebootet.

This 3D Engine stuff is still not useable if it crashes everywhere with VC++ isNaN()
runtime errors or if it crashes the whole operating system and reboots.

- Windows 7 x64 Ultimate
- AMD Radeon HD 6950 with 2GB memory
- Intel Core2 Quad CPU Q9450 with 8GB memory
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: glsl fragment and vertex shader 4.60

Post by PMV »

Danilo wrote:Nice example, but the PureBasic implementation of OGRE still has BIG problems.

First test some days ago just crashed your program after moving forward with the cursor key
in Fullscreen mode. Now i tested again:

The Mouse Cursor is not captured in fullscreen mode, so i can not look around.
It works in windowed mode.

I changed OpenControls() to OpenControls(1) to display the GUI. It worked!
After clicking the last UpDown Control (for ScaleV) of the GUI in fullscreen mode,
i got a bluescreen, memory dump, and PC rebootet.

This 3D Engine stuff is still not useable if it crashes everywhere with VC++ isNaN()
runtime errors or if it crashes the whole operating system and reboots.

- Windows 7 x64 Ultimate
- AMD Radeon HD 6950 with 2GB memory
- Intel Core2 Quad CPU Q9450 with 8GB memory
isNaN is a result of not allowed data submitted to the PB-OGRE implementation.
It is annoying that you don't get a Debugger-Message at the right line, but
as long as such checks aren't implemented, you can only search yourself against
this call. It is not a bug, it is more like an IMA because of not checked memory-
calls. :) With a little bit of luck you can find the error inside of OGRE.log
or CEGUI.log ... good to check this files always when you have problems.
And i remember i had similar problems at my start. Don't know what i have changed
then ... my used coordinates in my game are always positive, could be related to
that.

Or the MoveXXX-Commands are buggy, i always use LocateXXX for absolut position.


The Mouse-cursor is never captured by CEGUI, you need to submit the coordinates
to CEGUI by calling InputEvent3D(...) and ShowGUI(255, #True) or displaying
your own mousesprite at the current position.

I don't know what is really going wrong, i never had a bluescreen since my
development with PB-OGRE. But it is really hard to get a own created GUI
work. That is really a big problem especially many commands are still
unusable. But Fred knows that and hopefully we get fixes with 4.61.

MFG PMV
User avatar
idle
Always Here
Always Here
Posts: 5876
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: glsl fragment and vertex shader 4.60

Post by idle »

Danilo wrote:Nice example, but the PureBasic implementation of OGRE still has BIG problems.

First test some days ago just crashed your program after moving forward with the cursor key
in Fullscreen mode. Now i tested again:

Thanks, I haven't had any problems on Linux with the new engine it's improved a lot
the only issues I've had is that it doesn't release the mouse or keyboard which means
I'd need to reboot if I produced an IMA while the debugger was on.
After clicking the last UpDown Control (for ScaleV) of the GUI in fullscreen mode,
i got a bluescreen, memory dump, and PC rebootet.
Sorry about that! There was an issue with the inputs in the material script
it should be fine declaring them as light_position x but apparently it wasn't working
but then there's really no point use them there since you can just access the
light directly in the shader. I'll post a fix soon
This 3D Engine stuff is still not useable if it crashes everywhere with VC++ isNaN()
runtime errors or if it crashes the whole operating system and reboots.

True it shouldn't be spitting out isNaN() though it may not be fair to blame the 3Dengine for the system crash
with the demo, there was clearly a bug with the inputs to the shader.
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
idle
Always Here
Always Here
Posts: 5876
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: glsl fragment and vertex shader 4.60

Post by idle »

did a quick update and changed the shader inputs to use a single light
though I'm not sure if I've got the import function right for windows

It's not exactly an ideal way to interact with shaders though it's probably the best compromise
until the Engine gets updated to allow us to set uniforms, attributes, varings and samples

SpaceBar shows the gui
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

Re: glsl fragment and vertex shader 4.60

Post by [blendman] »

wow, thank you, it's a really great example ;) !

It should be include with the standard edition of purebasic 4.60, in the examples directory.
User avatar
idle
Always Here
Always Here
Posts: 5876
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: glsl fragment and vertex shader 4.60

Post by idle »

It will need to be retested on Windows and Mac but if it's works on all platforms
then yes it would be a good example to add, well at least until Fred gets around
to adding shader functions
Windows 11, Manjaro, Raspberry Pi OS
Image
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: glsl fragment and vertex shader 4.60

Post by PMV »

don't know how the second ocean should look like, but it seems to working well on windows :)
Post Reply