Modulative shadow missing on part of screen

Everything related to 3D programming
Prod
User
User
Posts: 14
Joined: Thu Mar 31, 2005 3:47 pm
Location: Denmark

Modulative shadow missing on part of screen

Post by Prod »

With modulative shadows and antialias on, shadows are not drawn on the top and left line of the screen. Bug or design?
Does not happen with SaveRenderTexture(). Only the edge of screen is affected, 1 pixel wide.
(Windows 10 x64, PB 5.31+5.50)
Image

Code: Select all

InitKeyboard() : InitEngine3D() : InitSprite()

AntialiasingMode(#PB_AntialiasingMode_x2)

ExamineDesktops()
OpenScreen(DesktopWidth(0),DesktopHeight(0),32,"",#PB_Screen_NoSynchronization)

WorldShadows(#PB_Shadow_Modulative,1000,RGB(64,64,64),512)

AmbientColor(RGB(64,64,64))
a=CreateLight(#PB_Any,RGB(255,255,255),1000,300,00,#PB_Light_Directional) : LightLookAt(a,0,0,0)
CreateCamera(#PB_Any,0,0,100,100)

texture=CreateTexture(#PB_Any,16,16)
StartDrawing(TextureOutput(texture))
    Box(0,0,16,16,RGB(255,255,255))
StopDrawing()
material=CreateMaterial(#PB_Any,TextureID(texture)) : mesh=CreateCube(#PB_Any,1)
a=CreateEntity(#PB_Any,MeshID(mesh),MaterialID(material),0,-2,0) : ScaleEntity(a,100,1,100)
entity=CreateEntity(#PB_Any,MeshID(mesh),MaterialID(material),0,0,-8)

Repeat
    ExamineKeyboard()
    If KeyboardReleased(#PB_Key_Escape)<>0
        Break
    EndIf
    RotateEntity(entity,0.4,0.5,0.6,#PB_Relative)
    RenderWorld() : FlipBuffers() : Delay(10)
ForEver
End
Last edited by Prod on Thu Aug 18, 2016 12:54 am, edited 2 times in total.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Modulative shadow missing on part of screen

Post by applePi »

Hi
i have tested your code in win7 and winxp with PB 5.31 and the shadow seems normal like this picture:
Image
the same shadow in PB 5.43.
if we add this in line 12:

Code: Select all

cam=CreateCamera(#PB_Any,0,0,100,100)
MoveCamera(cam, 0,70, 0.00001, #PB_Absolute)
CameraLookAt(cam,0,0,0)
so to position the camera high away over the scene we will see the whole shadow from above,

note: the 0.00001 because we can't see anything when we use absolute zero. may be Comtois look at this situation
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Modulative shadow missing on part of screen

Post by Comtois »

applePi wrote:note: the 0.00001 because we can't see anything when we use absolute zero. may be Comtois look at this situation
try this

Code: Select all

cam=CreateCamera(#PB_Any,0,0,100,100)
CameraFixedYawAxis(cam, #False)
MoveCamera(cam, 0,70, 0, #PB_Absolute)
CameraLookAt(cam,0,0,0)
Please correct my english
http://purebasic.developpez.com/
Prod
User
User
Posts: 14
Joined: Thu Mar 31, 2005 3:47 pm
Location: Denmark

Re: Modulative shadow missing on part of screen

Post by Prod »

Updated. Image included showing what should happen and what I get.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Modulative shadow missing on part of screen

Post by Comtois »

Prod wrote:With modulative shadows and antialias on, shadows are not drawn on the top and left line of the screen. Bug or design?
I dont know, probably an Ogre stuff.
Please correct my english
http://purebasic.developpez.com/
Post Reply