SyntaxBomb - Indie Coders

General Category => Showcase => Topic started by: Krischan on October 26, 2017, 21:28:52

Title: OpenB3D GLSL Sandbox Shader Demos
Post by: Krischan on October 26, 2017, 21:28:52
This is something I've been working on the last months to get more familar with OpenB3D and shaders. I didn't wrote the shaders myself, they are a favourite selection I've made from the great website www.glslsandbox.com (http://glslsandbox.com/) where you can run them in a browser. It wasn't too hard to migrate a shader to run with OpenB3D and I think we should use some of them as examples for OpenB3D - if there is no license problem, many should be CC or PD. Some of them are really breathtaking and I stopped after "only" 114 demo examples ;D But there are much, much more to explore on the website.

See attached ZIP for all of my favourite samples (not yet compiled as EXE to save a lot of space but they all run here with BlitzmaxOS and OpenB3D, didn't test them on NG yet but they should work too when you change the brl.timer lines to brl.timerdefault).
Title: Re: OpenB3D GLSL Sandbox Shader Demos
Post by: Qube on October 27, 2017, 20:06:08
Some nice looking shaders :) - What sort of things did you have to do to adapt for OpenB3D?
Title: Re: OpenB3D GLSL Sandbox Shader Demos
Post by: peteswansen on October 27, 2017, 20:57:54
Very nice..its great that the BRL followers have such talented programmers!!  (wish I was one...lol)
Title: Re: OpenB3D GLSL Sandbox Shader Demos
Post by: markcwm on October 27, 2017, 22:31:52
Hi,

I adapted a sandbox shader to show how to apply one to a surface, I couldn't see any usefulness for the engine in the 2d shaders so I never added one. Some of your examples could be adapted to a useful purpose, like the sun could be applied to one side of a skybox or the lava to a pool mesh, but one big problem is many are too slow, in fact some of them crashed my laptop, the mushrooms and one of the water ones, and many were just blank, but the sandbox demos often crashed my browser too so I had decided there was no point, but if you'd like to pick out shaders that are useful and fast then I'll add them to the Openb3d shaders.

To apply to a surface you change "gl_FragCoord.xy to gl_TexCoord[n].st" and in the vert use "gl_Position = ftransform();" or later equivalent, and to set the uvs up in the vert "gl_TexCoord[n] = gl_MultiTexCoord0;" also you don't have to use the built-in gl_TexCoord[n] you can use a varying vec2.
Title: Re: OpenB3D GLSL Sandbox Shader Demos
Post by: RonTek on October 28, 2017, 23:19:09
Cool demos Krischan! The atmospheric stuff are nice. I do like how OpenB3D works with post process shaders.