<ShadX> unregistried
| Created on 13.01.2005 - 18:27 |  |
Good, Mr. Guest, but you can speedup using vec3 .rgb Example: vec3 col = texture2DProj(OGL2Texture, gl_TexCoord[0]).rgb; //or .xyz .... gl_FragColor = vec4((d1*t1 + d2*t2 + d3*t3 + 0.875*col), 1.0) Bye
|
<ShadX> unregistried
| Created on 14.01.2005 - 13:46 |  |
Another speedup test:
gpuPeteOGL2.slv
// // [1XW][1YW][1ZW] // [2XW][2YW][2ZW] // [3XW][3YW][3ZW] //
uniform vec4 OGL2Param; uniform vec4 OGL2Size;
void main() { float offsetx = OGL2Param.x; float offsety = OGL2Param.y;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0; // center gl_TexCoord[1] = gl_TexCoord[0].xxxy + vec4(-offsetx, 0, offsetx, offsety); // top gl_TexCoord[2] = gl_TexCoord[0].xxxy + vec4(-offsetx, 0, offsetx, 0); // center gl_TexCoord[3] = gl_TexCoord[0].xxxy + vec4( offsetx, 0,-offsetx, offsety); // bottom }
gpuPeteOGL2.slf
// // [1XW][1YW][1ZW]=[colA][colB][colC] // [2XW][2YW][2ZW]=[colD][colX][colE] // [3XW][3YW][3ZW]=[colF][colG][colH] //
uniform vec4 OGL2Param; uniform vec4 OGL2Size; uniform sampler2D OGL2Texture;
void main() {
vec3 colA = texture2DProj(OGL2Texture, gl_TexCoord[1].xwyy).rgb; vec3 colB = texture2DProj(OGL2Texture, gl_TexCoord[1].ywyy).rgb; vec3 colC = texture2DProj(OGL2Texture, gl_TexCoord[1].zwyy).rgb; vec3 colD = texture2DProj(OGL2Texture, gl_TexCoord[2].xwyy).rgb; vec3 colX = texture2DProj(OGL2Texture, gl_TexCoord[2].ywyy).rgb; vec3 colE = texture2DProj(OGL2Texture, gl_TexCoord[2].zwyy).rgb; vec3 colF = texture2DProj(OGL2Texture, gl_TexCoord[3].xwyy).rgb; vec3 colG = texture2DProj(OGL2Texture, gl_TexCoord[3].ywyy).rgb; vec3 colH = texture2DProj(OGL2Texture, gl_TexCoord[3].zwyy).rgb;
gl_FragColor = vec4 ((0.2 * colX + 0.1 * (colA + colB + colC + colD + colE + colF + colG + colH)), 1.0); }
Mr. Guest, can you give a try? Bye
|
<ShadX> unregistried
| Created on 14.01.2005 - 13:51 |  |
Opss... another cut and past error... excuse me... Corrected gl_TexCoord[3]: gl_TexCoord[3] = gl_TexCoord[0].xxxy + vec4(-offsetx, 0, offsetx,-offsety); // bottom
|