Quan Posted January 29, 2010 Share Posted January 29, 2010 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: 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 Quote 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 More sharing options...
Marleys Ghost Posted January 29, 2010 Share Posted January 29, 2010 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) Quote 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 More sharing options...
Quan Posted January 29, 2010 Author Share Posted January 29, 2010 Cool that fixed it, Thanks. Thought I might have set something up wrong Quote 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 More sharing options...
Marleys Ghost Posted January 29, 2010 Share Posted January 29, 2010 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. Quote 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 More sharing options...
Josh Posted January 30, 2010 Share Posted January 30, 2010 This is called "shadow acne". If you look carefully, you can probably catch it in every game that uses shadow maps, at some point, to some degree. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.