Hi guys and gals,
Im just starting to dip my toe into 3D and was just testing things out, I've come across an issue when I turn SetShadowMappingMode on.
My screen resolution is set at 960 x 540 but when I run with shadow mapping mode on (either 1, 2 or 3) it basically just drops the drawable area to the bottom left quarter of the screen.
I include the code below. I assume its just something I have missed, but I've tried multiple different things and with no luck. My other assumption is it could be something to do with my integrated graphics on my MacBook Pro.
any help would be appreciated. thanks.
Steve
// Project: 3D Test Camera
// Created: 2018-11-09
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "3D Test Camera" )
SetWindowSize( 960, 540, 0 )
//SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
//SetVirtualResolution( 960, 540 ) // doesn't have to match the window
SetScreenResolution(960,540)
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetVSync( 1 )
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
// this example should work with AGK V1 and V2
//SetShadowMappingMode(2)
// create object plane
// without any further code the plane will be position at 0,0,0 and have a rotation of 0,0,0
// the rotation of 0,0,0 means that it will be parrallel with xy plane
CreateObjectPlane(1,150,150)
SetObjectRotation(1,90,0,0)
SetObjectPosition(1,0,-40,0)
SetObjectReceiveShadow( 1, 1 )
CreateObjectBox(2,50,50,50)
SetObjectPosition(2,0,-15,0)
SetObjectCastShadow( 2, 1 )
SetObjectReceiveShadow( 2, 1 )
// create a directional light (to make the scene look better)
//CreatePointLight(10, 100, 40, 60, 12000, 255, 5, 25)
//SetPointLightMode( 10, 1 )
SetSunActive(1)
// position and orientate the camera
SetCameraPosition(1,0,0,-150)
SetCameraLookAt(1,0,0,0,0)
// main loop
do
// rotate the plane
RotateObjectGlobalY(1,1)
RotateObjectGlobalY(2,1)
Print( ScreenFPS() )
Sync()
loop
EDIT: added Image for ref. Also noted this runs fine as put in, but if you uncomment Shadowmode then it gives the image attached.