Hi Insanity,
I wanted to share a restoration milestone that may be worth looking at for master.
PiccuEngine’s modern OpenGL path now reproduces the original Descent 3 D3D bump mapping much more faithfully. This was not a simple “shader polish” job. The original effect is split across several parts of the engine, so the work required tracing the CPU-side bump generation, the model UV setup, the D3D texture-stage semantics, and the OpenGL-side emulation.
A few key pieces:
Descent 3 bumpmap generation
int iDu = v00 - v01;
int iDv = v00 - v10;
*pDst++ = (sbyte)iDu;
*pDst++ = (sbyte)iDv;
// D3D legacy setup
lpD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BUMPENVMAP);
lpD3DDevice->SetTextureStageState(1, D3DTSS_BUMPENVMAT00, ... 1.0f ...);
lpD3DDevice->SetTextureStageState(1, D3DTSS_BUMPENVMAT11, ... 1.0f ...);
lpD3DDevice->SetTextureStageState(2, D3DTSS_TEXCOORDINDEX, 1);
Original D3 bump lookup in model code
float val = dotp * 0.5f;
p->p3_uvl.u2 = val;
p->p3_uvl.v2 = val;
// OpenGL shader side
vec2 bumpDelta.x = bump.x * bumpMat00 + bump.y * bumpMat10;
vec2 bumpDelta.y = bump.x * bumpMat01 + bump.y * bumpMat11;
vec2 envCoord = vEnvUV + bumpDelta;
vec3 env = texture2D(envTex, envCoord).rgb;
The main things that were restored:
the original D3 bump map data path
the original D3 u2/v2 lookup behavior
the D3-style BUMPENVMAP matrix semantics
the use of Environment.ogf when available
mipmapped/filtered sampling so the result doesn’t look blocky or flattened
What made this tricky was that several intermediate versions “worked” visually, but were still wrong in one of these layers. The hard part was not getting a shader to move. It was getting the OpenGL path to match the old D3D behavior closely enough that the effect reads like the original game instead of a modern approximation.
I’ve attached a progression of screenshots so the evolution is visible:
early reflect/facet attempt

blurry weird stage, haha!

intermediate blocky versions

very close to the final and good result!


the final smoother and nice filtered result, like original D3D descent3...

reference images from original D3D with bump and OpenGL without bump


If you think it’s useful, I’d be happy for this to be considered for master after review.
Thanks for all the work on PiccuEngine.
If you want more details, please, let me know.
It will be great to see this in the master branch, and for everyone can enjoy piccu like we always remembered it.
Hi Insanity,
I wanted to share a restoration milestone that may be worth looking at for master.
PiccuEngine’s modern OpenGL path now reproduces the original Descent 3 D3D bump mapping much more faithfully. This was not a simple “shader polish” job. The original effect is split across several parts of the engine, so the work required tracing the CPU-side bump generation, the model UV setup, the D3D texture-stage semantics, and the OpenGL-side emulation.
A few key pieces:
Descent 3 bumpmap generation
Original D3 bump lookup in model code
The main things that were restored:
the original D3 bump map data path
the original D3 u2/v2 lookup behavior
the D3-style BUMPENVMAP matrix semantics
the use of Environment.ogf when available
mipmapped/filtered sampling so the result doesn’t look blocky or flattened
What made this tricky was that several intermediate versions “worked” visually, but were still wrong in one of these layers. The hard part was not getting a shader to move. It was getting the OpenGL path to match the old D3D behavior closely enough that the effect reads like the original game instead of a modern approximation.
I’ve attached a progression of screenshots so the evolution is visible:

early reflect/facet attempt
blurry weird stage, haha!

intermediate blocky versions

very close to the final and good result!


the final smoother and nice filtered result, like original D3D descent3...

reference images from original D3D with bump and OpenGL without bump


If you think it’s useful, I’d be happy for this to be considered for master after review.
Thanks for all the work on PiccuEngine.
If you want more details, please, let me know.
It will be great to see this in the master branch, and for everyone can enjoy piccu like we always remembered it.