renderSceneCB :: Mesh
              -> LightingTechnique
              -> IORef GLfloat
              -> IORef Camera
              -> IORef Bool
              -> Texture
              -> Texture
              -> Texture
              -> DisplayCallback
renderSceneCB boxMesh lightingEffect gScale cameraRef bampMapRef texture normalMap trivialNormalMap = do
    cameraRef $~! cameraOnRender
    gScaleVal <- readIORef gScale
    camera <- readIORef cameraRef
    bampMapEnabled <- readIORef bampMapRef

    clear [ColorBuffer, DepthBuffer]

    enableLightingTechnique lightingEffect

    textureBind texture (TextureUnit 0)
    if bampMapEnabled
        then textureBind normalMap (TextureUnit 2)
        else textureBind trivialNormalMap (TextureUnit 2)

    setLightingWVP lightingEffect $ getTrans
        WVPPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0,
            persProj   = persProjection,
            pipeCamera = camera
        }
    setLightingWorldMatrix lightingEffect $ getTrans
        WPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0
        }

    renderMesh boxMesh

    swapBuffers
renderSceneCB :: Mesh
              -> LightingTechnique
              -> IORef GLfloat
              -> IORef Camera
              -> IORef Bool
              -> Texture
              -> Texture
              -> Texture
              -> DisplayCallback
renderSceneCB boxMesh lightingEffect gScale cameraRef bampMapRef texture normalMap trivialNormalMap = do
    cameraRef $~! cameraOnRender
    gScaleVal <- readIORef gScale
    camera <- readIORef cameraRef
    bampMapEnabled <- readIORef bampMapRef

    clear [ColorBuffer, DepthBuffer]

    enableLightingTechnique lightingEffect

    textureBind texture (TextureUnit 0)
    if bampMapEnabled
        then textureBind normalMap (TextureUnit 2)
        else textureBind trivialNormalMap (TextureUnit 2)

    setLightingWVP lightingEffect $ getTrans
        WVPPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0,
            persProj   = persProjection,
            pipeCamera = camera
        }
    setLightingWorldMatrix lightingEffect $ getTrans
        WPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0
        }

    renderMesh boxMesh

    swapBuffers
renderSceneCB boxMesh lightingEffect gScale cameraRef bampMapRef texture normalMap trivialNormalMap = do
    cameraRef $~! cameraOnRender
    gScaleVal <- readIORef gScale
    camera <- readIORef cameraRef
    bampMapEnabled <- readIORef bampMapRef

    clear [ColorBuffer, DepthBuffer]

    enableLightingTechnique lightingEffect

    textureBind texture (TextureUnit 0)
    if bampMapEnabled
        then textureBind normalMap (TextureUnit 2)
        else textureBind trivialNormalMap (TextureUnit 2)

    setLightingWVP lightingEffect $ getTrans
        WVPPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0,
            persProj   = persProjection,
            pipeCamera = camera
        }
    setLightingWorldMatrix lightingEffect $ getTrans
        WPipeline {
            worldInfo  = Vector3 0 0 3,
            scaleInfo  = Vector3 1 1 1,
            rotateInfo = Vector3 (-90) gScaleVal 0
        }

    renderMesh boxMesh

    swapBuffers