Juggernaut Posted March 18, 2013 Posted March 18, 2013 Hi, I am following the camera control tutorial of LE 2 as shown here - http://www.leadwerks.com/werkspace/page/Documentation/le2/_/tutorials/camera-controls-r385 When I move my mouse sideways I find a slight frosted glass or watery wave along surface of the brick columns and a bit jittery on the edges of the brick columns. What is causing this ? How can I fix it so that it does not happen in my game ? Thanks, Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 Can you provide a bit more info? Such as a picture or some code.or video. EDIT: Sounds like a graphics problem. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 Well the problem is that it happens only when I am moving the camera using the mouse. So I do not think a picture will tell the what I mean. You might be able to see it in the tutorial video if you are viewing it in high quality. It is more like a subtle heat-haze effect on the edges and surface of the brick columns - happens only when the camera is moved. No such effect noticed on the concrete floor though. Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 I watched the tutorial but could see nothing wrong. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 ok. But I think activating anti-aliasing can fix my issue. I found the function SetAntialias(); But when I call it after Graphics(), though the program builds but it does not run - throws run-time error. "Unhandled exception at 0x777015de in Game_3.exe: 0xC0000005: Access violation reading location 0x00000000." When should I call SetAntialias(1) ? Before Graphics() or after Graphics() or somewhere else ? Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 Are you using framework? That does a lot for you. No need for buffers etc. EDIT: The tutorial is somewhat dated. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 No. I am just trying to set up anti-aliasing working in that camera tutorial. Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 TFramework framework=CreateFramework(); if (!framework) { MessageBoxA(0,"Error","Failed to create framework.",0); return Terminate(); } TLayer layer = GetFrameworkLayer(0); TCamera cam=GetLayerCamera(layer); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); //DebugPhysics(true); // Post Processing FX SetGodRays(0); SetHDR(0); Framework creates a world for you. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 All right, I will try to look at that "Framework" thing first ..... if that is a wonder wand for us ( new comers ). It seems your code is in LUA and I am using C++ ...... so I guess I look for the C++ version of the framework. Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 Heres some code that sets up a third person camera. Easily changed to first person. NOTE: I have removed my own gameplay code and this may cause a syntax error. If so it will be something to do with curly brackets. #include "engine.h" TEntity scene; int main(int argc, char** argv) { Initialize(); RegisterAbstractPath( "c:/mygame"); Graphics(1100,800); AFilter(4) ; TFilter(1) ; TFramework framework=CreateFramework(); if (!framework) { MessageBoxA(0, "Error","Failed to create framework.",0); return Terminate(); } TLayer layer = GetFrameworkLayer(0); TCamera cam=GetLayerCamera(layer); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L, "fw"); lua_pop(L,1); DebugPhysics( false); // Post Processing FX SetGodRays(0); SetHDR(0); SetSSAO(0); SetBloom(0); SetAntialias(0); SetStats(1); SetReflectionElements(ENTITY_RENDERABLE); // Skybox SetSkybox(LoadMaterial( "abstract::NiceSky.mat")); //SetBackgroundColor(Vec4(1.0f, 1.0f, 1.0f, 1)); SetBackgroundColor(Vec4(1.12f, 0.82f, 0.82f, 1)); // Movement vars float move=0.0, strafe=0.0; TVec3 camrotation=Vec3(0); float mx=0, my=0; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); AmbientLight(Vec3(1.0)); // ************************* main loop ****************** while ( !KeyHit(KEY_ESCAPE )) UpdateAppTime(); UpdateWorld(AppSpeed()); mx=Curve(MouseX()-GraphicsWidth()/2,mx,6); my=Curve(MouseY()-GraphicsHeight()/2,my,6); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation.X=camrotation.X+my/10.0; camrotation.Y=camrotation.Y-mx/10.0; RotateEntity(cam,camrotation); move = 3.5 * (KeyDown(KEY_W) - KeyDown(KEY_S)); strafe = 3 * (KeyDown(KEY_D) - KeyDown(KEY_A)); float jump=0.0; if (KeyHit(KEY_SPACE)) { if (!ControllerAirborne(player)) { jump=8.0; } } // move faster if(KeyDown(KEY_E) ){ if (!ControllerAirborne(player)) { move*=3.0; strafe*=2.0; } } } //Position camera and 3rd person main character TVec3 playerpos=EntityPosition(player); TVec3 camerapos=EntityPosition(cam); camerapos.Y=Curve(playerpos.Y+ 0.80,camerapos.Y,2.0); camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z); camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z); PositionEntity(cam,camerapos); MoveEntity(cam,Vec3(0.3,0,-2.3)); UpdateController(player, camrotation.Y, move, strafe, jump, 500.0f); UpdateFramework(); RenderFramework() Flip(0) ; } } } // main Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 @cassius : Many thanks. Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
cassius Posted March 19, 2013 Posted March 19, 2013 its c code. Sorry it looks a bit messy. It was late and I was tired. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Juggernaut Posted March 19, 2013 Author Posted March 19, 2013 No problem Quote LEADWERKS 2.5 Leadwerks Engine Documentation http://www.leadwerks.com/werkspace/page/Documentation/le2 Leadwerks Engine Wiki http://web.archive.org/web/20120728123827/http://www.leadwerks.com/wiki/index.php?title=Main_Page Leadwerks 2 wiki moving to Google Drive https://drive.google.com/folderview?id=0BxLsUYPSspxcfms3bmpvQlBSVjVYREljSElpQ3JfTmQydzg4anExZ2Fyb0I3NjZxSmkwd1E&usp=drive_web
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.