… | |
… | |
124 | // the following variables are valid in the fragment shader as well as in the vertex shader |
124 | // the following variables are valid in the fragment shader as well as in the vertex shader |
125 | bool has_lightvec; // is a light vector available? |
125 | bool has_lightvec; // is a light vector available? |
126 | shader::temp_3f sh_lightvec; // not defined unless has_lightvec is true |
126 | shader::temp_3f sh_lightvec; // not defined unless has_lightvec is true |
127 | shader::temp_3f sh_colour; // always available for any light |
127 | shader::temp_3f sh_colour; // always available for any light |
128 | |
128 | |
129 | // vertex shader |
|
|
130 | virtual void vsh () = 0; |
|
|
131 | // fragment shader |
|
|
132 | virtual void fsh () = 0; |
|
|
133 | |
|
|
134 | virtual void enable (view &ctx); |
129 | virtual void enable (view &ctx); |
135 | virtual void disable (view &ctx); |
130 | virtual void disable (view &ctx); |
|
|
131 | |
|
|
132 | virtual void vsh () = 0; // vertex shader |
|
|
133 | virtual void fsh () = 0; // fragment shader |
136 | |
134 | |
137 | protected: |
135 | protected: |
138 | shader::varying_3f lightvec; |
136 | shader::varying_3f lightvec; |
139 | shader::varying_1f camdist; |
137 | shader::varying_1f camdist; |
140 | shader::uniform_3f lightpos; // or direction |
138 | shader::uniform_3f lightpos; // or direction |
… | |
… | |
144 | { |
142 | { |
145 | colour c; |
143 | colour c; |
146 | GLfloat intensity; |
144 | GLfloat intensity; |
147 | GLfloat radius; |
145 | GLfloat radius; |
148 | |
146 | |
|
|
147 | void enable (view &ctx); |
|
|
148 | void disable (view &ctx); |
|
|
149 | |
149 | void vsh (); |
150 | void vsh (); |
150 | void fsh (); |
151 | void fsh (); |
151 | }; |
152 | }; |
152 | |
153 | |
153 | #endif |
154 | #endif |