An extra camera to project the shadows?
A second set of UV's to get the shadow texture on.
A light preferably spot or direct.
Our coder has tried to get the shadows to work in our Ogre wrapper, and has got everything compiling without errors but the full screen looks as though it is all shadow. I don't understand the code, but I am concerned that the media isn't valid. It's just the standard robot Ogre robot positioned on a cube.

Our C++ coder for some reason shies away from posting on any forums, so I'm having to ask without really having much technical knowledge. Maybe someone will be able to see where the problem lies from the info and screenshot provided.
here's the source code:
I'm hoping someone can take a quick look at it, and let me know if theres something obvious missing. I suspect it may be the media since they are usualy on top of things on the coding front, the media hasn't to my knowledge been changed in any way from the Ogre SDK
Code: Select all
SuperStrict
Include "Headers/Flow_header.BMX"
AppTitle = "fG - Getting Started [Press ESC to Exit]"
'fG.init(False, 1024, 768, 16, False, fG.RS_OPENGL)
fG.init()
fG._viewport.setClearEveryFrame(True)
'Robot
Global robot:TEntity = fG.LoadMesh("robot", "robot.mesh")
'Cube
Global cube:TEntity = fG.createCube("Cube")
cube.getParentSceneNode().setPosition(0.0, - 50, 0.0)
cube.getParentSceneNode().SetScale(5, 1, 5)
'Light
Global light:TLight = fG.createLight("light", TLight.LT_SPOTLIGHT)
light.setDiffuseColour(1, 1, 1)
light.setSpotlightInnerAngle(TRadian.Create(1))
light.setSpotlightOuterAngle(TRadian.Create(2))
light.setAttenuation(5000, 1, 1, 1)
light.setPosition(0, 800, 100)
light.setDirection(0, - 1, - 1)
'Camera
Global Camera:TCamera = fG.getDefaultCamera()
Camera.setPosition(200, 150, 0)
Camera.lookAtWithVector3(robot.getParentNode().getWorldPosition())
Camera.setNearClipDistance(light.getAttenuationRange() * 0.01)
Camera.setFarClipDistance(light.getAttenuationRange())
'/Camera
'Set up soft shadows
fG._scene.setShadowTextureSelfShadow(True)
fG._scene.setShadowTextureCasterMaterial("shadow_caster")
fG._scene.setShadowTextureCount(1)
fG._scene.setShadowTextureSize(1024)
fG._scene.setShadowTexturePixelFormat(PF_FLOAT16_RGB)
fG._scene.setShadowCasterRenderBackFaces(False)
'That loop for setting bg colour, etc, goes here.
Global numShadowRTTs:Int = fG._scene.getShadowTextureCount()
For Local i:Int = 0 To numShadowRTTs - 1
Local tex:TTexture = fG._scene.getShadowTexture(i)
Local vp:TViewport = tex.getBuffer().getRenderTarget().GetViewport(0)
vp.setBackgroundColour(TColourValue.Create(1, 1, 1, 1))
vp.setClearEveryFrame(True)
Next
fG._scene.setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED)
Repeat
fG.TurnEntity(robot, 0, 1, 0)
fG.renderWorld()
fG.Flip()
Delay 16.6666667
Until KeyDown(KEY_ESCAPE) 




