Convert #version 330 shaders for PI
Posted: Fri Jun 01, 2018 4:59 pm
I've just come across these useful shaders for Phong shading
http://www.sunandblackcat.com/tipFullVi ... topicid=30
But they are for version 330and use a few features unavailable in the GLSL version on the PI.
Is anyone familiar with back porting shaders ?
I think I can just replace
"layout(location = 0) in vec3 i_position;" with "attrib vec3 i_position"
"out vec3 o_normal;" with "varying vec3 o_normal"
"in vec3 o_normal;" with "varying vec3 o_normal"
"layout(location = 0) uniform sampler2D u_diffuseTexture;" with "uniform sampler2D u_diffuseTexture;"
"out vec4 resultingColor;" with gl_fragColor
and they should work....
PeterO
http://www.sunandblackcat.com/tipFullVi ... topicid=30
But they are for version 330and use a few features unavailable in the GLSL version on the PI.
Is anyone familiar with back porting shaders ?
I think I can just replace
"layout(location = 0) in vec3 i_position;" with "attrib vec3 i_position"
"out vec3 o_normal;" with "varying vec3 o_normal"
"in vec3 o_normal;" with "varying vec3 o_normal"
"layout(location = 0) uniform sampler2D u_diffuseTexture;" with "uniform sampler2D u_diffuseTexture;"
"out vec4 resultingColor;" with gl_fragColor
and they should work....
PeterO