use this for the objects you want to cast shadow
SetObjectCastShadow ( objID, 1 )
use this command for objects you want to receive shadow
SetObjectReceiveShadow ( objID, 1 )
and if you are using this command set texStage to 0, not 1 as 1 will give it full brightness by default
SetObjectImage( objID, imageID, texStage )
here is an example of a block rotating around with a plane object for grass
SetWindowTitle( "Test shadows" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSunColor(255,255,255)
SetAmbientColor(100,100,100)
SetSunActive(1)
SetShadowMappingMode(3)
SetShadowSmoothing(1) // random sampling
SetShadowMapSize( 512, 512 )
SetShadowRange( -1 ) // use the full camera range
SetShadowBias( 0.0012 ) // offset shadows slightly to avoid shadow artifacts
block=CreateObjectBox(5,5,5)
SetObjectCastShadow(block,1)
grass=CreateObjectPlane(20,20)
RotateObjectLocalX(grass,90) //this rotates the grass so as it lays flat where you would want land
SetObjectPosition(grass,0,-5,5)
SetObjectColor(grass,0,200,0,255)
SetObjectReceiveShadow(grass,1)
repeat
rotateobjectLocalY(block,1)
Sync()
until GetPointerPressed()
fubar