GLBasic forum

Main forum => Off Topic => Topic started by: Moru on 2019-May-13

Title: Shaders
Post by: Moru on 2019-May-13
Would this be useful as a basis for learning shaders to use in GLBasic?
Title: Re: Shaders
Post by: Hemlos on 2019-May-13
shaders are wonky in glbasic
i have a thread somewhere with a couple examples
one of the main things is, you cannot pass vectors like typical shaders code eg. vec2 vec3 etc
To get it to work, you have to split inputs into single values and then pass them into the shader code.
other than that, shaders seem to work as expected, its just alot of work to convert them to glbasic friendly.

ps. no, i don't see enough info on those pages to get started in glbasic....there isn't anywhere on the web that will.
You have to learn the gpu language before even attempt glbasic shaders.
You have to learn minimally about vec2 vec3 vector lists, and be able to expand them into single dimensions as input.
Title: Re: Shaders
Post by: SnooPI on 2019-May-13
I don't see the problem you're talking about Hemlos  O_O
It's quite possible to use the GLSL in a normal way in GLB and using the vector system (vec2, vec3, vec4).
Title: Re: Shaders
Post by: Hemlos on 2019-May-14
Glbasic doesn't have vector variables, you have to pass single values, and rebuild it inside the shader code as a vec2 3 4
Title: Re: Shaders
Post by: SnooPI on 2019-May-14
But that's normal, it's like the interactions between GLB and C language O_O
This is not a problem specific to Shaders in GLB but a problem of normal conversion of data types between GLB and ... the rest.

I'm too tired to explain myself better on this subject (especially in English :rant:), but we'll talk again because it's an interesting subject ;)

Title: Re: Shaders
Post by: dreamerman on 2019-May-15
Already available shaders can be some base if you need basic/simple effects, only issue is that they are scattered on different forum threads.
Helmos I saw that topic some time ago but forgot to mark it, and now I can't find it :D
Title: Re: Shaders
Post by: Hemlos on 2019-May-15
hmm oh ya, i started this thread when i started playing with the shaders in glb

note: its 10 years old thread with some relevent information tho, however, i dont know if the code still works the same.
gernot helped share some important info there too
Title: Re: Shaders
Post by: dreamerman on 2019-May-15
Was it this topic? I think that there was also another one, but maybe not started by You, it had shaders included as sources not as attachments (that are now unavailable). Still this topic also gives some important info :)