Beta release 2.0.0b
Moderator: Moderators
Another important animation feature .. morph. Since the current Mesh component doesn't expose the vertex identity, all rendering is done using opengl32. Attached is a basic example using linear interpolation and 2 targets ( + base ) .. normally you'd use this in combination with F-Curves for facial animation / muscular deformation etc.
K
- Attachments
-
- Morph.zip
- (29.21 KiB) Downloaded 886 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Reason I didn't post a exe was because I have no idea whether it works on a ATI card or not ( and don't need to know either ), plus the effect is not resolution independent ( and there's a issue with the AspectRatio of FBO's using AutoPowerOfTwo ) .. just experimenting with different techniques.
Anyway, see attached.
K
- Attachments
-
- Bloom.zip
- (32.4 KiB) Downloaded 902 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
That's odd because searching is what google usually do best
If you do a normal google search for "glGenerateMipmapEXT zgameeditor" it finds the code:
http://code.google.com/p/zgameeditor/so ... nderer.pas
If you do a normal google search for "glGenerateMipmapEXT zgameeditor" it finds the code:
http://code.google.com/p/zgameeditor/so ... nderer.pas
Ok,
Then I might have scr*wed up somewhere .. here's the fragment shader ( perhaps u / v / offset need to be part of main .. or bloom set to vec4(0.0) ).
K
Then I might have scr*wed up somewhere .. here's the fragment shader ( perhaps u / v / offset need to be part of main .. or bloom set to vec4(0.0) ).
Code: Select all
uniform sampler2D tex1;
uniform float canvasWidth;
uniform float canvasHeight;
const float kernel[9] = {1.0/12.0,1.5/12.0,1.0/12.0,
1.5/12.0,2.0/12.0,1.5/12.0,
1.0/12.0,1.5/12.0,1.0/12.0};
float u = 16.0/canvasWidth;
float v = 16.0/canvasHeight;
vec2 offset[9] = {vec2(-u, v),vec2(0.0, v),vec2(u, v),
vec2(-u,0.0),vec2(0.0,0.0),vec2(u,0.0),
vec2(-u, -v),vec2(0.0, -v),vec2(u, -v)};
void main()
{
vec4 bloom;
for(int i=0; i<9; ++i)
{
bloom += texture2D(tex1, gl_TexCoord[0].xy+offset[i],4.0)*kernel[i];
}
gl_FragColor = texture2D(tex1, gl_TexCoord[0].xy)+bloom*4.0;
}
It complains about the syntax of initializing constant arrays.
This compiles ok:
This compiles ok:
Code: Select all
//...
const float kernel[9] = float[](1.0/12.0,1.5/12.0,1.0/12.0,
1.5/12.0,2.0/12.0,1.5/12.0,
1.0/12.0,1.5/12.0,1.0/12.0);
//...
vec2 offset[9] = vec2[](vec2(-u, v),vec2(0.0, v),vec2(u, v),
vec2(-u,0.0),vec2(0.0,0.0),vec2(u,0.0),
vec2(-u, -v),vec2(0.0, -v),vec2(u, -v));