Jump to content

Quan

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by Quan

  1. Quan

    Skybox

    Here is a little video of the new Skybox inside a basic test app. Its no where near as cool as Eternal Crysis skybox but its a start. Features a real time sun moving inside the skybox with the directional light matched to its movements. Also a cloud layer which can also move and change. Also a few screenshots from a more advanced version running inside my game: Moon testing as well. I am now working on a timing system to trigger transitions of the skybox texture for day/night and weather effects.
  2. I am still a complete newbie to Leadwerks and programming. I have only really spent most of my past scripting in other game engines ( Quake / Neverwinter ) and before that cramming programs into 64k on the C64. For me the power of the entity system is that yesterday I created a new Skybox system which features a moving sun tied to a directional light and cloud sphere. All done with entities and no real maths at all.
  3. After playing some more I have changed the code a bit by making sunlight:TEntity = e after which I can turn the sunlight, hide it etc. But I still can't seem to change its color with EntityColor. I think I know why because its now a TEntity instead of a TLight but I have no idea how to convert it. But my understanding of how things work increasing quite quickly.
  4. I am still a bit stuck when it comes to changing a entities properties inside a scene from Blitz max. Working with the sun idea, what I would like to do is change the colors during the day. I have tried doing e.color = Vec4(1,0,0,1) inside the selection loop but this ended up changing nothing visually and is probably going about it the wrong way.
  5. I have the Windows XP version, I see that there is a new preview release that does fix the flickering texture bug which is vista/7 only at the moment. I'll wait for this to come out for XP then give it a go.
  6. Works like a charm, thanks again. I still have a load more questions but I'll have a play for a bit and see what I can work out first.
  7. It was really odd, I updated the driver during the week to see if it fixed the Bad Company 2 flickering texture bug ( which it didn't ) and I hadn't touched my code since last weekend. Then when trying to demo my game it just randomly crashed. In blitz max it would fail to load 95% of the time, I did manage to get it to load once. Also the LE Editor was doing the same but less often. Anyway rolling back cleared up the problem. I'll give the Opengl 4 beta driver a go to see if it helps.
  8. This is what I was after. Thanks
  9. I have moved onto using scene files and the LE Editor to build my levels but I am struggling to work out how I can pick a entity and change its properties from inside Blitzmax on the fly. I have a directional light called sunlight which I would like to rotate and turn on / off etc. In the past I have just been creating a light in Blitzmax which is fine because I know what it is called but I can't seem to work out how I would find the sunlight entity from inside the loaded scene. Can anyone help me or point me to a example on the wiki. Thanks
  10. I was showing a family member today the stuff I had been doing but every time I went to load my game made in Blitzmax the engine would crash loading the scene with a exception_error ( can't quite remember the wording ). The editor would also do this about 10% of the time loading a scene. I rolled back to the 10.2 drivers and the problem went away. Has anyone else experienced this. I have a ATI 4870.
  11. I have been away for a bit and never saw if a fix for this got found. I thought I saw something but for the life of me I can't seem to find it on the forums. I am running 2.31 and am sure i have updated everything and thought things were fine until I tried to compile with the Blitzmax debugger enabled. This caused the same stop at fw.Render() If I compile without the debugger I don't get a crash. So to recap if I have a scene with a waterplane + pointlight in the same view with the Blitzmax debugger enabled I get a crash. If I do a normal build it works or if I delete the pointlight it works. Thanks
  12. I updated to the latest build of Leadwerks today and my program is working fine with emitters. Well I think it is, I installed the latest build to a new folder, pointed the appdir towards that folder then recopied the mod folders to blitzmax just to be sure.
  13. Have you tried it with: SetWorld(fw.transparency.world) Before the emitter and SetWorld(fw.Main.world) After it ? That is what I did in the end to get it to work but I am still running 2.3 and haven't upgraded yet.
  14. Ok will do. I'll wait until things have settled down before upgrading. Still I have learned a lot more from this thread even if my problem was a bit of a wild goose chase in the end. Btw, I am making a space game but got obsessed with trying to make snow, but it doesn't snow in space
  15. What I have working is the code above now. The sbx contains the scene + lights but no emitters. The emitter is just the snow effect. I think that I am still using 2.3 the version.txt says 2.3 if I run the updater it doesn't say there is any files that need to be updated.
  16. Thanks thats got it working. I was so close last night just didn't get the right words in setworld. By doing this I can now have a directional light + a emitter and no crash. I haven't tried doing any tests with pointlights + water yet.
  17. Yep. Now that I can see the snow I have noticed that its falling behind the water. I think this is because its on the wrong layer but I am not sure how to tell the emitter to be in the transparency layer. When it comes to using the framework I do get a bit lost
  18. Sitting down last night I dragged out the C++ compiler and did a bit more testing. What I found is I get the same sort of crash when I run this C++ code. If you change from a Directional Light to a point light it is fine. // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #include "engine.h" int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { Initialize() ; RegisterAbstractPath("C:/Program Files/Leadwerks Engine SDK"); SetAppTitle( "LWVS2008test" ) ; Graphics( 1024, 768 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); TEntity cam; cam=CreateCamera(0); MoveEntity(cam,Vec3(0,0,-5)); TMesh cube; cube=CreateCube(0); MoveEntity(cube,Vec3(1,0,0)); TMesh ground; ground=CreateCube(0); ScaleEntity(ground,Vec3(50,.1,50)); MoveEntity(ground,Vec3(0,-20,0)); TLight light=CreateDirectionalLight(); // causes crash. // TLight light=CreatePointLight(); // works fine. PositionEntity(light,Vec3(2,2,-2)); RotateEntity(light,Vec3(45,45,0)); SetShadowmapSize(light,512); TEmitter snowemitter = CreateEmitter(500,10000); PaintEntity (snowemitter,LoadMaterial("Abstract::dust.mat")); SetEmitterRadius (snowemitter,0,0.2); SetEmitterArea (snowemitter,Vec3(100)); SetEmitterVelocity (snowemitter,Vec3(0),Vec3(1)); SetEmitterAcceleration (snowemitter,Vec3(0,-0.5,0)); SetEmitterWaver (snowemitter,2.0); EntityParent(snowemitter,cam); // Game loop while( !KeyHit() && !AppTerminate() ) { TurnEntity(cube,Vec3(1,1,0)); UpdateWorld(1); SetBuffer(gbuffer); RenderWorld(RENDER_ALL); SetBuffer(BackBuffer()); RenderLights(gbuffer); Flip(1) ; } // Done return Terminate() ; }
  19. Been doing a bit more testing. It only gets upset if I load a scene with a directional light in it. As soon as I delete that light its happy but I guess that light is what creates the godrays. As a test I added a directional light to my test code with no scene and I got the same issue. Removed Emitters and the program compiles ( and I now have godrays ).
  20. Well it seems to work if I remove the lua scripts folder from my application folder: But then no water or sky but its a start.
  21. I have been playing around with loading scenes and working out how to use the framework when I ran into a problem with Emitters which I haven't been able to nut out. While loading a scene, I thought ' hey this would be cool with snow ' So I wipped up a emitter in a basic program then moved it into the scene loader. When I compile and run I first get a dialog box with just 0 in it. Then I get Unhanded Exception:Attempt to access field or method of null object. The debugger then points to fw.render() Any ideas as to what I am doing wrong with the Emitters ? Thanks Here is the code for the scene loader: Strict Framework leadwerks.engine Import "C:\Program Files\Leadwerks Engine SDK\BMX\Framework\framework.bmx" Include "lua-gluefunctions.bmx" AppTitle:String = "Test World" RegisterAbstractPath("C:\Program Files\Leadwerks Engine SDK\") Graphics 1024,768,0 AFilter(1) TFilter(1) Global fw:TFramework = TFramework.Create() If Not fw RuntimeError "Failed to initialize engine." SetScriptObject("fw", fw)'Setup the global script objects. SetPostFX()'Setup the post processing FX Local cam:TCamera = fw.Main.Camera MoveEntity cam, Vec3(0, 20, - 3) TurnEntity cam, Vec3(5, 0, 0) local scene:TEntity = LoadScene("abstract::basic.sbx") local snowemitter:TEmitter=CreateEmitter(100,1000) PaintEntity snowemitter,LoadMaterial("Abstract::dust.mat") SetEmitterRadius snowemitter,0,0.1 SetEmitterArea snowemitter,vec3(100) SetEmitterVelocity snowemitter,vec3(0),vec3(1) SetEmitterAcceleration snowemitter,vec3(0,-0.5,0) SetEmitterWaver snowemitter,2.0 'Local music:TSound = LoadSound("C:\BlitzMax\My Projects\LeadWerks Test\Sound\snowing.ogg") 'Global bgmusic:TSource = CreateSource(music,SOURCE_LOOP) 'PlaySource(bgmusic) Local camrotation:TVec3=Vec3(0) Local mx:Float Local my:Float Local move:Float Local strafe:Float HideMouse MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 While Not ( KeyHit (KEY_ESCAPE) ) 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 camrotation.y=camrotation.y-mx/10 RotateEntity cam,camrotation move =Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20) strafe =Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20) MoveEntity cam,Vec3(strafe/10,0,move/10) fw.Update() fw.render() Flip Wend 'Functions from Marleys Ghost simple scene loader http://leadwerks.com/werkspace/index.php?/topic/670-a-simple-scene-loader-in-blitzmax/ Function SetPostFX()'0 = off : 1 = on. fw.renderer.SetAntialias(1) fw.renderer.SetBloom(1) fw.renderer.SetGodRays(1) fw.renderer.SetHDR(1) fw.renderer.SetSSAO(0) fw.renderer.SetWireFrame(0) End Function Function SetScriptObject(name:String, o:Object) Local size:Int=GetStackSize() lua_pushbmaxobject(luastate.L,o) lua_setglobal(luastate.L,name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int=GetStackSize() If size<currentsize lua_pop(luastate.L,currentsize-size) EndIf EndFunction
  22. Thanks My Camera range was: CameraRange (cam, .1, 10000 ) and I changed it to: CameraRange (cam, 10, 10000 ) Which has made a huge difference.
  23. I am building a Space combat simulator using Blitzmax + Leadwerks and I have noticed that the further you get away from the center of the world the more my models start jiggling and suffering from Z Fighting. I think this is caused by floating point inaccuracy's and my poorly constructed model. I have thought about changing my program so that the ship stays at the center of the world and the world itself moves or scaling everything down so it fits inside a smaller space. I am wondering if anyone knows any other suggestions to minimize this ? Thanks
  24. Cool thanks, that clears things up. I saw the private folder but never clicked inside it. I think Dexsoft-games might get a sale out of me some time in the future
  25. This is a great example and has been helping me out a lot but I have one issue. If I try to load any map that uses the tree_spruce_2 asset as vegetation ( eg the terrain_arctic.sbx map ) I get the following error: Unhanded Exception:Zip data error Which is pointing towards the line in the basicsceneloader.bmx 'Load the scene. Global scene:TEntity = LoadScene("abstract::terrain_arctic.sbx") Thanks
×
×
  • Create New...