Custom reflection shader not working

Hello. I’m trying to get a BasicEffect-ed model to reflect a TextureCube. However, when I import the effect and try to manually override the models effect, it just makes it transparent and show the game’s clear color:

The model in question is the knife on the right. I’m using this shader (because I know little about shaders to write my own): Reflection.fx, and the code I use to set my model’s effect is like so:

/* Earlier in the code */
Effect test = Global.Content.Load<Effect>("Reflection");

....

foreach (ModelMesh e in meshes)
{
    foreach (ModelMeshPart mmp in e.MeshParts)
    {
        mmp.Effect = test;
        test.Parameters["Projection"].SetValue(MainGame.drawEffect.Projection);
        test.Parameters["World"].SetValue(transform);
        test.Parameters["View"].SetValue(MainGame.camera.View);
        test.Parameters["CameraPosition"].SetValue(MainGame.camera.Pos);
        test.Parameters["WorldInverseTranspose"].SetValue(Matrix.Transpose(Matrix.Invert(transform)));
        test.Parameters["SkyboxTexture"].SetValue(MainGame.texCube);

        foreach (EffectPass pass in test.CurrentTechnique.Passes)
        {
            pass.Apply();
        }
    }
    e.Draw();
}

If I don’t set the “SkyboxTexture” parameter, I get the exact same result as I am now, so I can’t tell if it’s the Skybox being broken, or the shader. However, I did try to use other shaders to achieve my goal too (ones that didn’t use a TextureCube), and this was always the same result. Even a generic Ambient shader yielded this same transparency.

Many thanks in advance, I’m really terrible with shaders :worried:

I see you’re using RB Whitaker’s reflection shader. :slightly_smiling:
Try using this:
test.Parameters["WorldInverseTranspose"].SetValue( Matrix.Transpose(Matrix.Invert(transform * mesh.ParentBone.Transform)));
So normals should be transformed to model space, not just world (“transform”) space.

Thank you, I’ll give that a try… Sorry, same outcome. The model is a .fbx exported from Blender if it helps. When I don’t change its effect, it looks just like the hand (as in, it renders like I would expect it to).

Also, please note that if I change the order that the models are drawn, the knife becomes invisible (it becomes obscured by the background and the hand).

Also, could the problem be the cubemap I’m importing? It’s the same cubemap that’s used in the example, so I know it’s fine. But maybe it’s not importing?