diff options
Diffstat (limited to 'examples/rendering-basic-light')
-rw-r--r-- | examples/rendering-basic-light/shaders/rendering-basic-light.frag | 15 | ||||
-rw-r--r-- | examples/rendering-basic-light/shaders/rendering-basic-light.vert | 22 |
2 files changed, 24 insertions, 13 deletions
diff --git a/examples/rendering-basic-light/shaders/rendering-basic-light.frag b/examples/rendering-basic-light/shaders/rendering-basic-light.frag index 6f561531..ce202e32 100644 --- a/examples/rendering-basic-light/shaders/rendering-basic-light.frag +++ b/examples/rendering-basic-light/shaders/rendering-basic-light.frag @@ -1,6 +1,7 @@ -varying mediump vec3 vNormal; -varying mediump vec3 vFragPos; -uniform mediump vec3 viewPos; // custom uniform +//@version 100 + +INPUT mediump vec3 vNormal; +INPUT mediump vec3 vFragPos; struct Material { @@ -16,8 +17,12 @@ struct Light mediump vec3 color; }; -uniform Material material; // custom uniform -uniform Light light; // custom uniform +UNIFORM_BLOCK CustomFrag +{ +UNIFORM mediump vec3 viewPos; // custom uniform +UNIFORM Material material; // custom uniform +UNIFORM Light light; // custom uniform +}; void main() { diff --git a/examples/rendering-basic-light/shaders/rendering-basic-light.vert b/examples/rendering-basic-light/shaders/rendering-basic-light.vert index bc5c85af..d39ec461 100644 --- a/examples/rendering-basic-light/shaders/rendering-basic-light.vert +++ b/examples/rendering-basic-light/shaders/rendering-basic-light.vert @@ -1,12 +1,18 @@ -attribute mediump vec3 aPosition; // DALi shader builtin -attribute mediump vec3 aNormal; // DALi shader builtin -uniform mediump mat4 uMvpMatrix; // DALi shader builtin -uniform mediump vec3 uSize; // DALi shader builtin -uniform mediump mat4 uModelView; // DALi shader builtin -uniform mediump mat3 uNormalMatrix; // DALi shader builtin +//@version 100 -varying mediump vec3 vNormal; -varying mediump vec3 vFragPos; +INPUT mediump vec3 aPosition; // DALi shader builtin +INPUT mediump vec3 aNormal; // DALi shader builtin + +UNIFORM_BLOCK Vanilla +{ +UNIFORM mediump mat4 uMvpMatrix; // DALi shader builtin +UNIFORM mediump vec3 uSize; // DALi shader builtin +UNIFORM mediump mat4 uModelView; // DALi shader builtin +UNIFORM mediump mat3 uNormalMatrix; // DALi shader builtin +}; + +OUTPUT mediump vec3 vNormal; +OUTPUT mediump vec3 vFragPos; void main() { |