Jump to content

klepto2

Developers
  • Posts

    927
  • Joined

  • Last visited

Everything posted by klepto2

  1. klepto2

    .NET Headers

    new Headers with source are available: Leadwerks C# Headers next on todo: fixing Vehicles
  2. How about saving it as png and then using the freeimage lib to convert it to dds? Of course it would be nice if Josh includes the dds saver but in the meantime this might be a solution.
  3. klepto2

    C# Source

    Yes, you just drop the control as every other control in your form. the Custombuffer is automatically created. The control will provide 2 extra events. 1. OnInit: In there youinitilize your objects, framewerk etc. 2. OnUpdate: In there you update the code ( no Flip needed as it this is done autmatically) You only need to keep track of your own buffers via the resize events. Both the TAO Control and the OpenTK Control are working exactly the same as the control, so you can swap the controls without changing the underlying code. (I prefer the OpenTK as it is still continued and already offers OGL4.0). I still need to fix some issues. But I think i will upload my version the coming weekend.
  4. klepto2

    C# Source

    Sorry to hear that you don't have time to continue on this, I will continue working on the delegates and some other functions which are currently missing or named wrong. I also have 2 working Leadwerks Controls (1 for the TAO Framework and 1 for the OpenTK lib). I will post the new files as soon as possible.
  5. I'm still working on this issue, but for the meantime you can surround the UpdateWorld command with a Try Catch Block. Not elegant but it seems to work.
  6. No, but I need to to investigate a bit further. If i remember correctly there was a need to Marshal the structs. Yesterday I wasn't able to solve it but hopefully i will solve everything over eastern weekend.
  7. Hi, I will start today to implement the missing functions (As long as i find everything) If someone is functions/delegates he/she is missing in the current release please post them here. So I'm able to better find the missing functions. Also I will add a Leadwerks Control and send it to Ubu, maybe he will add it to the main assemblies. @Rekindeled Phoenix: This needs some investigation, I remember that it works without issues in the old wrapper maybe something with the delegate definition is wrong.
  8. It seems you're not yet unlocked for the 2.3 SDK release. As you see you're still in the SDK 2.0 Group. If that changes to 2.3 Owner or the like then you will be able to download the 2.3 release. I don't know when you have purchased the update but keep in mind that the purchase is not an automated process and Josh needs to register it manually.
  9. Very Good work the design looks really nice. I have 3 things I would like to see asap: Core.GetSize needs to be: public delegate void GetSize(ref int _width,ref int _height); CustomBuffers are missing (I need them for a Leadwerks Gui Control) class Buffer is colliding with System.Buffer and needs to be resolved with Leadwerks.Buffer. My first OOP Model was based on the bmx class design to keep the source nearly identical a small class diagram:
  10. klepto2

    LE IDE

    yeah, by the way: bmx is open enough to integrate it. I have written ides and debuggers for bmx so if you need a hand on this part i will of course help. Maybe it will become a good bmx ide replacement and alternative to Blide. But all in all your vision looks promising. I hope you can make it true.
  11. klepto2

    LE IDE

    I know what you mean and I also think VS IDE is the best IDE out there. And I think your idea isn't bad but why using an IDE based on VS Shell when eg for C++ or C# developers a complete set of tools is already given and are more tested? Don't get me wrong, I will be happy if you can proove me wrong
  12. klepto2

    LE IDE

    The idea itself sounds good, but i doubt that anything produced with the sdk will have the same comfort as the various IDEs available. Also I believe Leadwerks should concentrate to bring the engine to the next level (new tools, features etc). An IDE for every language (or even the most supported) will only disapoint users coming from other specialized IDEs (IMHO).
  13. Forget the linepicking if you want it to update in realtime. I don't know whats going wrong with the terrainElevation function but it looks much less accurate as it should be. For a single patch it linepicking slows down to 2 - 5 fps, so no option. I will look a bit deeper in it as i need this function myself.
  14. material: texture0="abstract::sun.dds" clamp0=0,0,0 blend=1 depthmask=0 depthtest=1 overlay=1 zsort=1 cullface=1 castshadows=0 specular=1.00000000 bumpscale=1.00000000 gloss=0.500000000 shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse_alphablend.frag" shadowshader="abstract::mesh_shadow.vert","" As MasterXilo already said, if you use alphablend textures within the mainworld it can produce unwanted effects. eg if you use this material in the mainworld you would just see brighter legs of the model but nothing on the terrain. Building it as a shader is my next step. I have done it with my own engine previously and i know it is more accurate then the non gpu approach.
  15. Of couse you can paint it with a material I will work on it a bit more and then I will post it in the archives.(I planned this feature for later but now i can also finish it;) ) there are some issues if the terrainelavtion is not giving exact values. Also you may need to set it to the transparent world if you need to use alpha textures like the above.
  16. I have put together a small prototype in my test application (Blitzmax) : And thats the code of the class: Type TTerrainPlane Global list:TList = New TList Global terrain:TTerrain Field Mesh:TMesh Method New() list.AddLast(Self) End Method Function Create:TTerrainPlane(parent:TEntity, Scale:Float = 1.0) Local p:TTerrainPlane = New TTerrainPlane p.Mesh = CreatePatch(32, 32, parent) ScaleMesh(p.Mesh, [scale, 1.0, Scale]) MoveEntity(p.Mesh, [- Scale / 2.0, 0.0, -Scale / 2.0]) Return p End Function Function SetTerrain(t:TTerrain) TTerrainPlane.terrain = t End Function Function Update() If terrain = Null Then Return For Local Plane:TTerrainPlane = EachIn list Plane.Calculate() Next End Function Method Calculate() For Local Si:Int = 1 To Mesh.CountSurfaces() Local surf:TSurface = Mesh.GetSurface(Si) For Local Vi:Int = 0 To surf.CountVertices() - 1 Local vertex:TVec3 = TFormPoint(surf.GetVertexPosition(Vi), mesh, Null) ; Local newpos:TVec3 = Vec3(vertex.X, TerrainElevation(terrain, vertex.X, vertex.Z) + 0.01, vertex.Z) surf.SetVertexPosition(Vi, TFormPoint(newpos, Null, Mesh)) Next Next End Method End Type Function CreatePatch:TMesh(xsegs:Int = 1, zsegs:Int = 1, parent:TEntity = Null) Local x:Int,z:Int Local mesh:TMesh Local count:Int Local surf:TSurface mesh = CreateMesh(parent) surf=mesh.AddSurface() For z=0 To zsegs For x=0 To xsegs count=surf.AddVertex([Float(x)/Float(xsegs),0.0,Float(z)/Float(zsegs)],[0.0,1.0,0.0],[Float(x)/Float(xsegs),1.0-Float(z)/Float(zsegs)]) If x>0 And z>0 surf.AddTriangle(count-1,count,count-xsegs-1) surf.AddTriangle(count-1,count-xsegs-1,count-xsegs-2) EndIf Next Next mesh.Update() Return mesh EndFunction Maybe this helps.
  17. There is another Terrainfunction called TerrainEvaluation, this will give you the correct height value. the terrainheight function must be muliplied by the terrain y-scale value. x,y = x,z it is just y because you actually read from a texture in 2d space not 3d. the interpolation is because calculating the correct value (eg: fining the correct chunk, finding the correct triangle and then finding the point in triangle) is far to slow for these kind of things. The interpolation takes the 4 nearest full pixel values of the point (the point itself is a float) and performs a cubic interpolation between these points (weighting is based on distance from the real point to the full pixel). This technique is much faster and as long you don't have really oversized tilesizes it is accurate enough.
  18. I missed your 3rd point where you handle the height issue (which will result in the 1 long raycast I've mentioned). As said: I would go the "terrainheight" way or the shader way. But there is also a cheaper raycast method: Do it the other way round ! Do a raycast from the vertex position at zero level (x,<=0, z) and do raycast up to the real vertexposition. Now just add an offset and you will have the same result but with generally lower raycast lengths. Well the number of raycasts depends on the pc the application is running on. It can run smooth with yours but can be very slow on other machines.
  19. Doesn't sound bad but doing a raycast for all vertices may cost lots of cpu power. Remember that you need 2 raycasts with short ranges or 1 with a range of maximum terrainheight - vertexY because you don't know if the point is above or below the terrain. I believe you have 2 options here: 1. Use directly the Terrainheight function which interpolates the height at given points / may be also cpu heavy and depends highly on used vertices. 2. Write a meshshader which aligns the vertices on thy fly to the terrainheight. Terrainheightmap and everything else needed for this should be available in the shader pipeline.
  20. I would try to make my own CreatePlane function. Somewhere in this forum was a sample function posted by Josh (maybe the old forum). Also you may have a look at the road script. there you find code how to morph / align vertices to the terrain height. for optimal results you have to adjust the vertex spacing to fit the terrain resolution. Also there was a thread about terrain decals (by TylerH if i remember correctly) which looks like the thing you want.
  21. I'm currently working on my loading and setup routines and I think it may be useful to have some kind of callback for the LoadScene function. Currently my scene is relatively small and small splashscreen is enough for indicating loading. But i if the scene files grow and the loading of a scene takes much longer i would like to present progress on my loading screen. Maybe you can add a callback as an optional parameter to the loadscene function: main_scene = LoadScene("abstract::map_x_1_y_2.sbx", LoaderProgress) Function LoaderProgress(progress:TSceneProgress) DrawImage(splash, 512.0 - loadimg.Width() / 2.0, (768.0 / 2.0) - (loadimg.Height() / 2.0)) Local total:Int = progress.GetTotalItems() Local loaded:Int = progress.GetLoadedItems() DrawText "Loading... " + (loaded / Float(total)) * 100 + "%",20,20 Flip() End Function
  22. this works really great ! thx.
  23. thx. http://www.dexsoft-games.com/models/fantasy_warrior.html
  24. Well, long time has passed since i have written a new entry. While I'm still working on the asset manager and Texture Converter (non threading version) I have prototyped a small animation class in Blitzmax which can handle multiple animations at once for a single mesh. eg: you can walk and use your sword in the same time. Everything is handled automatically you just give a root animation a speed factor and a blend factor. Later you can simply add an 'extra'- animation to the mesh by using the bonename and an animation name. As you will notice in the video i have not yet synced some values eg: when does an once time played animation blend out. But i think the video gives an idea what is possible with Leadwerks Engine. Here is a small codesnippet from my sample project how animation is handled: If JUMP = 0 Then If move = 0 Then scene_helper.playeranimator.SetMainAnimation("Idle") scene_helper.playeranimator.SetAnimSpeed(3) ; Else If Abs(move) >= 1.5 Then scene_helper.playeranimator.SetMainAnimation("run") scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 2.0) ; Else scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 3) ; scene_helper.playeranimator.SetMainAnimation("walk w/o sword") End If End If Else scene_helper.playeranimator.SetMainAnimation("jump", ANIMSTYLE_ONCE) scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 3) ; End If If MouseHit(MOUSE_LEFT) scene_helper.playeranimator.SetExtraAnimation("Bip01_R_UpperArm", "attack combo", ANIMSTYLE_ONCE) End If If MouseHit(MOUSE_RIGHT) scene_helper.playeranimator.SetExtraAnimation("Bip01_L_UpperArm", "pick up", ANIMSTYLE_ONCE) End If
  25. The black sky was a problem i had myself as i have switched from lua back to bmx for my main project. Have you done: 'To Generate an updated lua-gluefunctions.bmx uncomment the lines tagged [1] 'and comment out the line tagged [2]. Run the code once, then swap back. 'lua-gluefunctions.bmx needs to be inside the App directory. Import "PATH TO YOUR 2.3 SDK FOLDER\BMX\Framework\framework.bmx" 'Import lugi.generator '[1] Include "lua-gluefunctions.bmx" '[2] 'generateGlueCode("lua-gluefunctions.bmx") '[1] 'End '[1] Also you need the script folder (which you find in the root directory of the editor) in the folder your app is in. After I have done this i could load the scene as if i have opened it in the editor.
×
×
  • Create New...