N
nfitc1
Guest
I'm pretty sure it's always been this way.
If I'm correct, then every shader effect should be rendered in the world space. Though, I don't know if the PC version does render in that way. :-[The PSOne has a co-processor called the Graphics Transform Engine, which is meant to perform many 3D operations like matrix-vector multiplication, lighting and fog. It was fixed-point
- (aka: integer) based and couldn't work with floating point numbers. The X, Y and Z coordinates of vectors are stored as 16-bit values: 1-bit for sign, 3-bits for integral part and 12-bits for the decimal part. It only supported 3x3 rotation matrices with translation being a separate operation using vectors with 32-bit XYZ integer components (no fractional parts).
This seems to be one reason behind the wobbliness: while drawing a scene, the objects's polygons must be transformed from their local space into world space (at the very least one rotate and one translate command) and then from world into camera space (another rotate and translate). Since translation is integer-only (no fractional), it will "snap" around, the severity depending on the scale of the scene elements. Also, if you have multiple rotations and translations stacking on top of each other, the precision errors will build up quickly.
[IMG]http://i.imgur.com/ei3C9Cz.jpg[/IMG] | [IMG]http://i.imgur.com/xLXEEAd.jpg[/IMG]
positive value | negative value
[IMG]http://i.imgur.com/Qm2rGw2.jpg[/IMG] | [IMG]http://i.imgur.com/ZADHJsF.jpg[/IMG]
positive value | negative value
[IMG]http://i.imgur.com/gyuKGU8.jpg[/IMG] | [IMG]http://i.imgur.com/YVrFOm2.jpg[/IMG]
positive value | negative value
//== PROGRAM LINK STATUS = TRUE//== PROGRAM VALIDATE STATUS = TRUE//======================================================// Vertex Shader 2 //======================================================//== SHADER COMPILE STATUS = TRUE#version 110uniform int vertextype;uniform bool fb_texture;uniform int blend_mode;uniform mat4 d3dprojection_matrix;uniform mat4 d3dviewport_matrix;void main(){ vec4 pos = gl_Vertex; gl_FrontColor.rgba = gl_Color.bgra; // TLVERTEX if(vertextype == 3) { pos.w = 1.0 / pos.w; pos.xyz *= pos.w; pos = gl_ProjectionMatrix * pos; } // LVERTEX and VERTEX else { pos = d3dviewport_matrix * d3dprojection_matrix * gl_ModelViewMatrix * pos; if(gl_FrontColor.a > 0.5) gl_FrontColor.a = 0.5; } // BLEND_NONE if(blend_mode == 4) gl_FrontColor.a = 1.0; // BLEND_25P else if(blend_mode == 3) gl_FrontColor.a = 0.25; gl_TexCoord[0] = gl_MultiTexCoord0; if(fb_texture) gl_TexCoord[0].t = 1.0 - gl_TexCoord[0].t; gl_Position = pos;}//======================================================// Fragment Shader 3 //======================================================//== SHADER COMPILE STATUS = TRUE#version 110uniform int vertextype;uniform sampler2D tex;uniform bool texture;uniform bool fb_texture;uniform bool modulate_alpha;void main(){ vec4 color = gl_Color; vec4 texture_color; texture_color = texture2D(tex, gl_TexCoord[0].st); if(texture) { if(fb_texture && texture_color.rgb == vec3(0.0, 0.0, 0.0)) discard; if(texture_color.a == 0.0) discard; color *= texture_color; if(!modulate_alpha) color.a = texture_color.a; } gl_FragColor = color;}