Jump to content

Grainy lighting


Quan
 Share

Recommended Posts

I just started working my way though the basics of using Leadwerks with BlitzMax and I noticed that my end result with the Lighting tutorial seems a bit Grainy:

 

lwlighting.png

 

I have a ATI 4870 using the 10.1 drivers. As far as I can tell I am not getting the same effect in the editor.

 

And this is the code I copied and pasted from the pdf file:

 

'Use the Leadwerks Engine module as our base 
Framework leadwerks.engine 

'Create an OpenGL graphics window 
Graphics 800,600

'Allows the engine to find files and load files from zip packages 
RegisterAbstractPath AppDir 

'Create a world 
If Not CreateWorld() RuntimeError "Failed to create world." 

'Create a camera 
cam:TCamera=CreateCamera() 
MoveEntity cam,Vec3(0,0,-5) 

'Create a visual mesh 
mesh:TMesh=CreateCube() 

'Create another mesh to cast a shadow on
ground:TMesh=CreateCube() 
ScaleMesh ground,Vec3(10,0.1,10) 
PositionEntity ground,Vec3(0,-2,0)

'Create a render buffer
buffer:TBuffer=CreateBuffer(800,600,BUFFER_COLOR0|BUFFER_DEPTH|BUFFER_NORMAL)

'Create a light

light:TLight=CreateSpotLight()
PositionEntity light,Vec3(2,2,-2) 
RotateEntity light,Vec3(45,45,0)

'Main loop 
While Not KeyHit(KEY_ESCAPE) 

TurnEntity mesh,Vec3(0.5)

'Update timing, physics, and other miscellaneous updates 
UpdateWorld 

'Make our render buffer the current buffer
SetBuffer buffer

'Draw the world 
RenderWorld 

'Make the back buffer the current buffer
SetBuffer BackBuffer()

'Call the RenderLights command, passing our buffer which contains 
'color, depth, and normal data
RenderLights(buffer)

'Swap the graphics buffers so we can see what we drew 

Flip 

Wend

 

Thanks

BMax 1.38 * Leadwerks 2.4 * Unity 3.0 Pro * Intel Core 2 Duo 6600 - Win7 64bit - ATI 4870

Link to comment
Share on other sites

You simply need to adjust SetShadowmapSize or SetShadowQuality or SetShadowOffset or play with a combination of them ;)

 

Try simply adding after you create the light:

 

'Create a light

light:TLight=CreateSpotLight()
PositionEntity light,Vec3(2,2,-2) 
RotateEntity light,Vec3(45,45,0)

SetShadowmapSize(light, 512)

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Cool that fixed it, Thanks.

 

Thought I might have set something up wrong ;)

 

 

No problems ;) the other settings you can look up thier use HERE on the wiki pages. Sometimes it is simply a case of changing the default values.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...