We are aware of gmogre.dll. Unfortunately we have to decline your offer because we are not interested in any extension or. Unfortunately we have to decline your offer because we are not interested in any extension or learning new languages. And we recommend you to upgrade your gm8 to the latest update which will give you 200-400 FPS.
You misunderstand the problem then. The problem is that calculating the part of a texture to use for reflections is, while not too expensive for a shader, FAR too expensive to do in GM. (Even the latest GM8.1 version) Even if you solved the problem of the expensive computation times, drawing primitives in GM (no, you can't use a model because the texture coordinates change) is extremely slow, no matter what version you use.
This is not exactly what you're asking for, but I just made a tiny example of how to make objects appear to be "shiny".
http://www.host-a.net/u/playway/shinyobject.zip
This is 1\5 part of this mission. Well it is a beginning and a good idea.
What you want is full cube-mapped (or sphere-mapped) environment mapping, which is what we have been discussing.
You can be pretty sure that it's damn hard to do if TheSnidr says it's hard to do.
JF.K said in 1962
We choose to go to the moon as nation in this decade not because they are easy but haaard to do.
We choose to do shade reflections without a dll as a community because it is not easy to achieve but very hard.
We did not attempt to go to the moon in a horse-drawn carriage.
If we cant make it we shall fake it.
Computer graphics has always been about faking it. Your problem is that GM is unsuited to even the simplest methods of faking it.
Anyway, I've said my piece about your delusions, so here's something to make my contribution useful: (It's code to find spheremap uv coordinates given a point, a normal, and a camera)
// get_spheremap_uv(x, y, z, nx, ny, nz, camera_x, camera_y, camera_z, up_x, up_y, up_z, camera_nx, camera_ny, camera_nz)
var normalSquared, dotProduct, reflection_x, reflection_y, reflection_z, left_x, left_y, left_z, up_x, up_y, up_z, front_x, front_y, front_z, inverseFront, inverseLeft, inverseReflection, uvLength, spheremap_w;
// Prepare result for null case.
global.spheremap_u = 0.5;
global.spheremap_v = 0.5;
normalSquared = argument3 * argument3 + argument4 * argument4 + argument5 * argument5;
if (normalSquared == 0) // Null case (normal undefined)
exit;
front_x = argument12;
front_y = argument13;
front_z = argument14;
left_x = front_y * argument11 - front_z * argument10;
left_y = front_z * argument9 - front_x * argument11;
left_z = front_x * argument10 - front_y * argument9;
if ((left_x == 0) && (left_y == 0) && (left_z == 0)) // Null case. Left vector undefined
exit;
// If front and left are perpendicular, |up| = |left| * |front|.
up_x = front_y * left_z - front_z * left_y;
up_y = front_z * left_x - front_x * left_z;
up_z = front_x * left_y - front_y * left_x;
reflection_x = argument0 - argument6;
reflection_y = argument1 - argument7;
reflection_z = argument2 - argument8;
if (argument3 * reflection_x + argument4 * reflection_y + argument5 * reflection_z < 0) {
dotProduct = 2 * (reflection_x * argument3 + reflection_y * argument4 + reflection_z * argument5) / normalSquared;
reflection_x -= dotProduct * argument3;
reflection_y -= dotProduct * argument4;
reflection_z -= dotProduct * argument5;
}
global.spheremap_u = reflection_x * left_x + reflection_y * left_y + reflection_z * left_z;
global.spheremap_v = reflection_x * up_x + reflection_y * up_y + reflection_z * up_z;
if (global.spheremap_u != 0) or (global.spheremap_v != 0) // Transform from reflection to sphere position.
{
inverseReflection = 1 / sqrt(reflection_x * reflection_x + reflection_y * reflection_y + reflection_z * reflection_z);
inverseFront = 1 / sqrt(front_x * front_x + front_y * front_y + front_z * front_z);
inverseLeft = 1 / sqrt(left_x * left_x + left_y * left_y + left_z * left_z);
// Half-angle identity: sin(a / 2) = sqrt(0.5 - cos(a) / 2)
spheremap_w = (reflection_x * front_x + reflection_y * front_y + reflection_z * front_z) * inverseFront * inverseReflection;
uvLength = inverseLeft * inverseReflection / sqrt(2 - 2 * spheremap_w);
global.spheremap_u *= uvLength;
global.spheremap_v *= uvLength * inverseFront;
}
global.spheremap_u = 0.5 + global.spheremap_u * 0.5;
global.spheremap_v = 0.5 + global.spheremap_v * 0.5;