Soft Shadows
Posted: Sat Jul 13, 2013 3:42 pm
How to create soft shadows on Purebasic???? Like this http://dlight.ru/images/mrs05.jpg
Is it impossible??
Is it impossible??
Code: Select all
Enumeration
#cyl
#TEX
#TEX_plane
#MAT
#plane
#LIGHT
#CAMERA_ONE
#BUTTON
#mainwin
EndEnumeration
Global Quit.b = #False
If OpenWindow(#mainwin, 0, 0, 500, 480, "press ESC to exit...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
InitEngine3D()
InitSprite()
InitKeyboard()
OpenWindowedScreen(WindowID(#mainwin), 0, 0, 500, 400, 0, 0, 0)
;WorldShadows(#PB_Shadow_Additive)
WorldShadows(#PB_Shadow_Modulative, -1, RGB(213, 250, 213))
SetFrameRate(60)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "Examples/Sources\Data", #PB_3DArchive_FileSystem)
Add3DArchive("/", #PB_3DArchive_FileSystem)
CreateMaterial(#TEX_plane, LoadTexture(#TEX_plane, "white.jpg"))
CreatePlane(#plane, 10, 10, 1, 1, 1, 1)
CreateEntity (#plane, MeshID(#plane), MaterialID(#TEX_plane))
CreateCylinder(#cyl, 2, 4.5)
LoadTexture(#TEX, "DosCarte.png")
CreateMaterial(#MAT, TextureID(#TEX))
CreateEntity(#cyl, MeshID(#cyl), MaterialID(#MAT))
;ScaleEntity(#cyl,0.5,0.5,0.5)
EntityRenderMode(#cyl, #PB_Entity_CastShadow)
MoveEntity(#cyl,-3,2.5,0)
CreateLight(0,RGB(255,255,255),-100,40,30)
CreateLight(1,RGB(0,255,0),-100,40,30)
AmbientColor(RGB(10,10,10))
CreateCamera(#CAMERA_ONE, 0, 0, 400, 400)
MoveCamera(#CAMERA_ONE, 0, 4, 9)
CameraLookAt(#CAMERA_ONE, 0, 2, 0)
RotateCamera(#CAMERA_ONE, -15, 0, 0)
EndIf
Repeat
Event = WindowEvent()
RenderWorld()
FlipBuffers()
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Escape)
Quit = #True
EndIf
Until Quit = #True Or Event = #PB_Event_CloseWindow