-
Posts
929 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by klepto2
-
hi, it was me who was contacting you. I'm currently working on some Extensions to the LE.Net Wrapper including a class which handle Awesomium. Some details can be found in my blog here: http://www.leadwerks.com/werkspace/blog/16/entry-672-extending-lenet/ And here is a newer screenshot which shows a small test app with interactive Awesomium on a cube. (Mouse and Keyboard input is working) Feel free to contact me via MSN/ICQ or Mail.
-
Hi folks, here is a new relatively short entry to my blog introducing my current side project (which will be the base of my bigger secret project) which I will make public to the community. I'm calling this project "Leadwerks.Extensions". In detail it is a project which will extend the current LE.Net headers with a set of setalite assemblies which will contain and provide some additional functions to the .Net community. My goal is to release a first set of dlls this weekend containing at least 3 assemblies. 1. Leadwerks.Extensions.Common The basic assembly containing shared functions used by all other assemblies but also providing some helpful functions like enabling rawGL mode, additional engine.dll commands. 2. Leadwerks.Extensions.Drawing Providing a growing library of 2D funtionality like animated images, viewport and scissor commands, and a lot more 3. Leadwerks.Extensions.Awesomium A picture often says more than words I have a lot of ideas for upcoming extensions (GUI, AI, IK, GameManagement, etc.), but if you have ideas or wishes feel free to post them in the comments. thx for your attention and more details will follow this weekend.
-
File Name: TAdvancedPick (Tpick with uv coordinates) File Submitter: klepto2 File Submitted: 09 Jun 2011 File Category: BlitzMax A small Type I have used in my own gui. It takes a TPick type and calcualtes the correct UVW coordinates. Click here to download this file
-
Hi, I have started a small project called Leadwerks.Extensions. The goal is to provide some deeper functionality from Blitzmax to other languages (not Blitzmax commands directly, but eg missing commands from the provided dll. I have started a test dll which should made my realtime cubemap code available to all languages. Unfortuntly I become errors in the code itself. The function access itself works well, but in the buffer creation function i get access violation errors (protected memory) when using glGenFramebuffersEXT. Here is my current Blitzmax code: SuperStrict Framework leadwerks.ENGINE Const COMPILE_DLL:Int = True Private Function ObjectPointer:Byte Ptr(o:Object) If o=Null Return Null Local p:Byte Ptr p=o p:-8 Return p EndFunction Public Type TCubeBuffer Field texture:TTexture Field buffer:TBuffer Field rb:Int[1] Field fb:Int[1] Field sb:Int[1] Field db:Int[1] Function Create:TCubeBuffer(texture:TTexture,buffer:TBuffer) Local cb:TCubeBuffer = New TCubeBuffer Notify "Debug 1" cb.Texture = texture Notify "Debug 2" cb.Buffer = buffer Notify "Debug 3" cb._BuildBuffer() Notify "Debug 4" cb.Buffer.Framebuffer = cb.fb[0] Notify "Debug 5" cb.Buffer.colorbuffer[0] = texture Notify "Debug 6" Return cb End Function Method _BuildBuffer() Notify "Debug 3.1" Local w:Int = texture.reference._Width Notify "Debug 3.2" Local h:Int = texture.reference._Height Notify "Debug 3.3" glBindTexture(GL_TEXTURE_CUBE_MAP , texture.reference._index) Notify "Debug 3.4" glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y , 0 , GL_RGBA8 , w , h , 0 , GL_RGBA , GL_UNSIGNED_BYTE , Null glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP , GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE) ; glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP , GL_TEXTURE_MIN_FILTER , GL_LINEAR) ; Notify "Debug 3.5" glGenFramebuffersEXT(1 , fb ) Notify "Debug 3.5.1" glGenRenderbuffersEXT(1 , rb) Notify "Debug 3.5.2" glGenRenderbuffersEXT(1 , sb) Notify "Debug 3.6" glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , fb[0]) ; glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT , GL_TEXTURE_CUBE_MAP , texture.reference._index, 0) ; Notify "Debug 3.7" glBindRenderbufferEXT(GL_RENDERBUFFER_EXT , rb[0]) ; glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24 ,W, H); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT , GL_DEPTH_ATTACHMENT_EXT , GL_RENDERBUFFER_EXT , rb[0]) Notify "Debug 3.8" glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , 0) glBindRenderbufferEXT(GL_RENDERBUFFER_EXT , 0) ; End Method Method Set(cubeface:Int) SetBuffer(buffer) Select cubeface Case 0 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_X,texture.reference._index,0) Case 1 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_X,texture.reference._index,0) Case 2 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_Y,texture.reference._index,0) Case 3 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,texture.reference._index,0) Case 4 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_Z,texture.reference._index,0) Case 5 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,texture.reference._index,0) End Select End Method Method Unset() glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , 0) End Method Method CheckFBOStatus:Int(index:Int = 0) Local status:Int = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) Select status Case GL_FRAMEBUFFER_COMPLETE_EXT Print index + ": FBO Complete" Case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT Print index + ": Incomplete attachment" Case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT Print index + ": Missing attachment" Case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT Print index + ": Incomplete dimensions" Case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT Print index + ": Incomplete formats" Case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT Print index + ": Incomplete draw buffer" Case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT Print index + ": Incomplete read buffer" Case GL_FRAMEBUFFER_UNSUPPORTED_EXT Print index + ": Framebufferobjects unsupported" EndSelect Return Status End Method End Type Function CubeBuffer_Create:TCubeBuffer(cubemap:TTexture , cubemapbuffer:TBuffer) "win32" If COMPILE_DLL Then GCEnter() Notify "Create_Start" If cubemap <> Null Then Notify "Cubemap valid" If cubemapbuffer <> Null Then Notify "cubemapbuffer valid" Local b:TCubebuffer = TCubeBuffer.Create(cubemap , cubemapbuffer) Notify "buffer created" Return b End Function Function CubeBuffer_ActivateFace(cubebuffer:TCubebuffer , face:Int = 0) "win32" If COMPILE_DLL Then GCEnter() cubebuffer.Set(face) End Function Function CubeBuffer_Deactivate(cubebuffer:TCubebuffer) "win32" If COMPILE_DLL Then GCEnter() cubebuffer.UnSet() End Function Function CreateCubemap:TTexture(width:Int , height:Int) "win32" If COMPILE_DLL Then GCEnter() Return Leadwerks.Engine.CreateCubemap(width , height) End Function I have added some debug notfiies to check where the error occurs. The same code called from Blitzmax works. Using it from C# it fails and throws the error in line 64. (glGenFramebuffersEXT(1 , fb ) ) The CreateCubemap command works well. Does anybody know what is causing this and maybe how to solve this issue? thx in advance
-
Hi folks, while working on my other projects I have started to research why the cubemapping doesn't seem to work in Leadwerks in Realtime. I have debugged through the code ( I was using Blitzmax to have access to the full debug output and fields of textures and buffers) and found out that it seems you can't create a real Leadwerks buffer for Cubemaps, I have also investigated TylerH' s early approach after the CreateCubemap command was added and from my experience with miniB3D extended I came to the conclusion that something must be wrong in Joshs solution and handling for realtime cubemaps. In Tylers lua sample he creates 6 buffers for each side of the cubemap, which is not needed when using fbo (Framebuffer objects). With this in mind I have integrated my old fbo code from 'miniB3D extended' and stripped it down to just support cubemaps and fit it (maybe a bit messy) into the existing buffer system (no I have no source license). The first result was promising and so i was extending my sample to handle full cubemaps and i was amazed how fast the result was. This is the result: The real fps without recording is double as high as it is showing in the video. Here is my code: ' ==================================================================== ' This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard ' Written by Rimfrost Software ' http://www.rimfrost.com ' ==================================================================== SuperStrict Framework leadwerks.ENGINE Local world:TWorld Local gbuffer:TBuffer Local camera:TCamera Local mesh:TMesh Local light:TLight Local ground:TMesh Local material:TMaterial Local materialfloor:TMaterial 'GCSetMode(2) RegisterAbstractPath( "D:/LESDK232r5/" ) Graphics(800,600) world=CreateWorld() If Not world RuntimeError "Failed to create world." gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_DEPTH|BUFFER_COLOR0|BUFFER_COLOR1|BUFFER_COLOR2) camera=CreateCamera() PositionEntity camera,[0.0,0.0,-4.0] material=LoadMaterial("abstract::cubemap.mat") materialfloor = LoadMaterial("abstract::cobblestones.mat") mesh = CreateSphere(32) ScaleEntity mesh,[2.0,2.0,2.0] PaintEntity mesh,material light=CreateDirectionalLight() RotateEntity light , [45.0 , 45.0 , 45.0] Local cubemap:TTexture = CreateCubemap(512 , 512) Local cubemapbuffer:TBuffer = CreateBuffer(512 , 512) SetColorBuffer(cubemapbuffer , cubemap , 0) Local cubebuffer:TCubeBuffer = TCubeBuffer.Create(cubemap,cubemapbuffer) SetMaterialTexture( material , cubemap , 0) Local p:TPivot = CreatePivot() Local sp:TMesh = CreateSphere(16,p) MoveEntity sp , [4.0 , 0.0 , 0.0] EntityColor sp,[1.0,0.0,0.0,1.0] Local p1:TPivot = CreatePivot() Local sp1:TMesh = CreateSphere(16,p1) MoveEntity sp1 , [4.0 , 0.0 , 0.0] EntityColor sp1,[0.0,1.0,0.0,1.0] Local p2:TPivot = CreatePivot() Local sp2:TMesh = CreateSphere(16,p2) MoveEntity sp2 , [4.0 , 0.0 , 0.0] EntityColor sp2,[0.0,0.0,1.0,1.0] Local skybox:TMEsh = CreateCube() ScaleMesh skybox , [4.0 , 4.0 , 4.0] FlipMesh skybox EntityShadowMode skybox,0 PaintEntity skybox,LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat") EntityColor skybox,[1.0,1.0,1.0,1.0] Local frame:Int = 0 Repeat TurnEntity p , [0.0 , AppSpeed() * .5 , 0.0] TurnEntity p1, [0.0,-AppSpeed()*.5,0.0] TurnEntity p2, [0.0,0.0,AppSpeed()*.5] If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit UpdateAppTime() UpdateWorld(AppSpeed()) SetBuffer(cubemapbuffer) PositionEntity camera , [0.0 , 0.0 , 0.0] ScaleEntity camera,[1.0 , -1.0 , 1.0] HideEntity mesh Local stage:Int = frame Mod 6 If stage = 0 Then cubebuffer.Set(0) RotateEntity camera,[0.0 , -90.0 , 0.0] RenderWorld() Else If stage = 1 Then cubebuffer.Set(1) RotateEntity camera,[0.0 , 90.0 , 0.0] RenderWorld() Else If stage = 2 Then cubebuffer.Set(2) RotateEntity camera,[-90.0 , 0.0 , 0.0] RenderWorld() Else If stage = 3 Then cubebuffer.Set(3) RotateEntity camera,[90.0 , 0.0 , 0.0] RenderWorld() Else If stage = 4 Then cubebuffer.Set(4) RotateEntity camera,[0.0 , 0.0 , 0.0 ] RenderWorld() Else If stage = 5 Then cubebuffer.Set(5) RotateEntity camera,[0.0 , -180.0 , 0.0] RenderWorld() End If cubebuffer.UnSet() ScaleEntity camera,[1.0 , 1.0 , 1.0] RotateEntity camera,[0.0 , 0.0 , 0.0] PositionEntity camera , [0.0 , 0.0 , - 4.0] ShowEntity mesh SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) SetBlend BLEND_ALPHA DrawText(UPS(),0,0) SetBlend 0 Flip(0) frame:+1 GCCollect() Forever gbuffer=Null FreeEntity light GCCollect() End Type TCubeBuffer Field texture:TTexture Field buffer:TBuffer Field rb:Int[1] Field fb:Int[1] Field sb:Int[1] Field db:Int[1] Function Create:TCubeBuffer(texture:TTexture,buffer:TBuffer) Local cb:TCubeBuffer = New TCubeBuffer cb.Texture = texture cb.Buffer = buffer cb._BuildBuffer() cb.Buffer.Framebuffer = cb.fb[0] cb.Buffer.colorbuffer[0] = texture Return cb End Function Method _BuildBuffer() Local w:Int =texture.reference._Width Local h:Int = texture.reference._Height glBindTexture(GL_TEXTURE_CUBE_MAP , texture.reference._index) glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y,0,GL_RGBA8 ,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,Null glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y , 0 , GL_RGBA8 , w , h , 0 , GL_RGBA , GL_UNSIGNED_BYTE , Null glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP , GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE) ; glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP , GL_TEXTURE_MIN_FILTER , GL_LINEAR) ; glGenFramebuffersEXT(1, fb ) glGenRenderbuffersEXT(1 , rb) glGenRenderbuffersEXT(1 , sb) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , fb[0]) ; glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT , GL_TEXTURE_CUBE_MAP , texture.reference._index, 0) ; glBindRenderbufferEXT(GL_RENDERBUFFER_EXT , rb[0]) ; glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24 ,W, H); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT , GL_DEPTH_ATTACHMENT_EXT , GL_RENDERBUFFER_EXT , rb[0]) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , 0) glBindRenderbufferEXT(GL_RENDERBUFFER_EXT , 0) ; End Method Method Set(cubeface:Int) 'glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , fb[0]) SetBuffer(buffer) Select cubeface Case 0 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_X,texture.reference._index,0) Case 1 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_X,texture.reference._index,0) Case 2 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_Y,texture.reference._index,0) Case 3 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,texture.reference._index,0) Case 4 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_POSITIVE_Z,texture.reference._index,0) Case 5 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT , GL_COLOR_ATTACHMENT0_EXT ,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,texture.reference._index,0) End Select 'glgetError() End Method Method Unset() glBindFramebufferEXT(GL_FRAMEBUFFER_EXT , 0) End Method Method CheckFBOStatus:Int(index:Int = 0) Local status:Int = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) Select status Case GL_FRAMEBUFFER_COMPLETE_EXT Print index + ": FBO Complete" Case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT Print index + ": Incomplete attachment" Case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT Print index + ": Missing attachment" Case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT Print index + ": Incomplete dimensions" Case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT Print index + ": Incomplete formats" Case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT Print index + ": Incomplete draw buffer" Case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT Print index + ": Incomplete read buffer" Case GL_FRAMEBUFFER_UNSUPPORTED_EXT Print index + ": Framebufferobjects unsupported" EndSelect Return Status End Method End Type One downside is that currently I get INVALID_ENUM error in debug mode, but I have no idea why as it is thrown from engine itself. Also this is unfortunatly a Blitzmax only hack as it needs some access to some not provided fields. But maybe Josh can use this code to finally integrate proper support of realtime cubemapping into the engine. thx for reading klepto2
-
Yes I'm using Lazlo's Leadwerks.Net. I have already got Images working ( you can load from file, byte[], stream or from Leadwerkstexture. Then you can draw them scaled, rotated, tiled, normal or just a part of it.)
-
Hi guys, finally I have some more freetime back and have restarted developing with Leadwerks more intensively in C#. Currently I'm working on multiple extensions for the .NET Wrapper of Leadwerks and I'm also finishing / continuing developing my tools. Later I hope this will all fit in one easy to use framework. First here is a screen of new nightsky texture used in my lua daynight script (not completely correct scaled) : the texture was made by taking screenshots from the stellarium software ( http://www.stellarium.org ) and building a cubemap out of them. Also I have started an advanced 2D Library for Leadwerks.Net : This is the current 2D code for the image above: public void Render() { Drawing2D.Enabled = true; //Enables Rendering of 2D Elements in native OpenGL Drawing2D.SetViewRotation(m_angle2, 1024f/ 2f, 768f / 2f); //Rotates the complete Viewport around given point Drawing2D.SetBlend(BlendMode.Alpha); // Set differten Blendmodes Drawing2D.SetColor(255, 0, 0, 1.0f); // Set Color for the following drawing calls Drawing2D.DrawLine(0, 0, 1024, 768); // Draws a line Drawing2D.SetColor(0, 255, 0, 0.5f); Drawing2D.DrawLine(0, -100, 1024, 768); Drawing2D.SetColor(0, 0, 255, 0.5f); Drawing2D.DrawLine(0, 100, 1024, 768); Drawing2D.SetColor(255, 0, 255, .5f); // Set the Drawing Handle of the next items to draw //(eg: normally all items are rotated at their local [0,0] coordinate, this function offsets this point by the given point) //values of 10,10 would rotate the following rects around their center. Drawing2D.SetHandle(50, 50); for (int i = 0; i < 150; i++) { if (i % 2 == 0) Drawing2D.SetRotation(m_angle); //Sets current rotation for the following drawings else Drawing2D.SetRotation(-m_angle); Drawing2D.DrawRect(10.24f + i * 10.24f, 7.68f + i * 7.68f, 20, 20); // Draws a rect } m_angle += 0.02f; m_angle2 += 0.04f; Drawing2D.Enabled = false; // Disables raw OpenGL Mode } The module will have its own Image handling (Leadwerks textures can be used as well) and much more. This is a brief overview and will be continued...
-
you don't need an extra class in C. You can simple load the entity and adjust the settings via SetEntityKey.
-
You may have to change the OpenGL states to fit the needs of MyGui. try something like this: leglBegin(GetLayerCamera(background), cameraZoom); MyGUImanager.Render(); leglEnd(true); // End and specify that we used 3D projection legl.h // Includes, libs #pragma comment(lib,"opengl32.lib") #pragma comment(lib,"glu32.lib") #include "engine.h" #include <gl/gl.h> // Standard opengl include. #include <gl/glu.h> // GLU include. // Constants enum CullMode { CULL_NONE, // Both sides of faces are drawn. CULL_DRAW_CCW, // Only faces defined by vertices declared in ccw order will be drawn (default). CULL_DRAW_CW // Same as above but cw. }; // Commands (declarations) void leglBegin (TCamera camera = NULL, float zoom = 1.0f, CullMode cm = CULL_DRAW_CCW); void leglEnd (bool was3D = false); void leglBindTexture(TTexture texture); // Implementations (definitions) // Use NULL for the camera to set up 2D drawing instead of 3D. // The "zoom" parameter is only required because there's no GetCameraZoom() function. void leglBegin(TCamera camera, float zoom, CullMode cm) { // Setup projetion according to argument if (NULL != camera) { // Save current projection matrix. Then reset glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); // Calculate the view frustum float nearRange, farRange; GetCameraRange(camera, nearRange, farRange); float theta = 1.0f / zoom; // tan(45°) = 1.0f float aspect = float(BufferWidth(CurrentBuffer()))/BufferHeight(CurrentBuffer()); glFrustum (-nearRange*theta, nearRange*theta, -nearRange/aspect*theta, nearRange/aspect*theta, nearRange,farRange); // Reset transformation glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); // LE uses a differently handed coordinate system than ogl does glScalef(1.0f, 1.0f, -1.0f); // Calculate the LookAt vectors (camera direction and up vector)... TVec3 from = EntityPosition(camera, true); TVec3 to = {0,0,-1}; to = TFormVector(to, camera, NULL); to += from; TVec3 up = {0,1,0}; up = TFormVector(up, camera, NULL); // Set LookAt gluLookAt(from.X, from.Y, from.Z, to.X, to.Y , to.Z, up.X, up.Y, up.Z); } else { glPushMatrix(); // Set orthographic projection (used for 2D drawing) // Get the current viewport/buffer size. int vPort[4]; glGetIntegerv(GL_VIEWPORT, vPort); // Set the projection gluOrtho2D(0, vPort[2], vPort[3], 0); // like glOrtho(0, vPort[2], vPort[3], 0, -1, 1); // Reset transformation glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); } // Setup default drawing settings. // Alpha blending. glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Backface culling. if (CULL_NONE != cm)glEnable(GL_CULL_FACE); if (NULL != camera)glCullFace((CULL_DRAW_CCW == cm) ? GL_BACK : GL_FRONT); else glCullFace((CULL_DRAW_CCW == cm) ? GL_FRONT : GL_BACK); // Depth test for 3D projection if (NULL != camera)glEnable(GL_DEPTH_TEST); // Drawing color. glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } // Use NULL (0) for the texture to reset (bind no texture) void leglBindTexture(TTexture texture) { if(NULL != texture) { glEnable(GL_TEXTURE_2D); BindTexture(texture, 0); // LE command. } else { glBindTexture(GL_TEXTURE_2D, NULL); glDisable(GL_TEXTURE_2D); } } // End drawing. Set "was3D" to true if you specified a camera at leglBegin (= used 3D projection). void leglEnd(bool was3D) { // Undo changes only made in 3D mode (camera != NULL) if (was3D) { glMatrixMode(GL_PROJECTION); glPopMatrix(); glDisable(GL_DEPTH_TEST); } else glPopMatrix(); // Reset transformation. glMatrixMode(GL_MODELVIEW); glPopMatrix(); // Undo changed settings. glDisable(GL_BLEND); glCullFace(GL_BACK); glDisable(GL_CULL_FACE); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); leglBindTexture(NULL); }
-
newer Version is available here: http://leadwerks.com/werkspace/index.php/topic/3104-day-night-script/
-
I have seperated the properties into new sections. I have also noticed new bug with the Ambient settings, as a workaround place a normal Ambient light and use this instead.
-
Hi, thx for the feedback. I have uploaded an updated version ( Download at first post). Changes: - Removed unneeded references to lua files - Fixed the ambientlight bug. - Reordered the Options and splitted them in different categories
-
thx macklebee, I will add it to the toolbox as soon as it is stable and balanced enough. Currently the dawn and dusk effect is a bit out of sync (the effect starts to early and stays to long). intensity.lua and suncolor.lua are data scripts i have used in an earlier version and i have forgotten to delete the references in the current script. They are not needed.
-
Hi, after long silence I want to present a small wip script/shader which replaces the Atmosphere script in the Editor with a dynamic sky tool. The other options from the old atmosphere script are all available through mine. [screen] [Download] DayNight.zip [installation] Unzip this in the models/Environment folder (or somewhere you like within your SDK/Editor folder) and restart the Editor. Keep in mind that this is still WIP and needs tweaking on various aspects, also I will add moving clouds in a later version. I hope you like it and I waiting for feedback. thx klepto2
-
wip = Work in progress Save Mesh will save the mesh with the new materials and ready to use with LE. I'm also thinking about adding the abillity to load meshes in different formats / edit them and make them LE ready. It will also split (optionally) the mesh by worlds. eg: a house normally imported as one Mesh with submeshes and surfaces, the walls etc will be located in the main world, but things like windows should normally be rendered in the transparent world. My tool will split the meshes by the world and create a lua script with a base mesh, which will provide the submeshes to the correct worlds, even colored shadows will be supported.
-
Hi, I want to introduce you to a tool i'm currently developing. Yes it is a material editor (again ) but this one will have some more features in the end. Features i want to include: - Realtime Material Editing (done) - Save new Mesh (wip) - Export as prefab ( you will be able to add entities like particles, othe meshes etc. and my tool will create a prefab mesh with a lua script/materials etc ready for LE Editor) - and much more. Here is a small preview of the material editor: I'm using the new C# headers (thx to Lazlo and tyler). I will keep you informed on progress and will provide a demo as soon as possible.
-
First thx for the fast fix. 1. GetPrefferedMaterialName was critical for me because I wasn't able to access surface properties at all. This was due an internal Entrynotfound exception and causes the running program to stop. 2. Global/Local Vectors (ok bad description) Position and Rotation of an entity have a global and a local value. How to get them? 3. I don't use a reflector, but i have tried to implement SetVertexColor/GetVertexColor to my CoreAdditions as I need them for highlighting selected surfaces. And by doing this i have noticed this issue. If i have used a reflector i might have seen that this is wanted behaviour . Why are you making the mesh.Scale so complicated? Why don't you just renew the mesh.Scale property with MeshScale and then you can access them like this: m.Scale ; ScaleMesh ((Entity)m).Scale ; ScaleEntity
-
Ok, some more things i have found. -- ScaleMesh isn't included in the OOP header. -- How to retrieve global or local vectors? -- GetPreferedMaterialName isn't defined in the Engine.dll !! Critical !! Cant use the Surface object -- Color cast from float[] to Color doesn't multiply with 255 (backcast from color to float[] devides by 255)
-
I have succesfully converted my LEControl yesterday and i will contribute it as soon as it is tested and works stable.
-
At first congrats for releasing it and thx for the hard work you both have done so far. I have found some small additions/bugs: Missing functions -- CreateSurface | Declared only in Core but not in Mesh or Surface -- Get/SetVertexColor | Not declared in Core Small bug: -- TriangleVertex returns void, but should return int. Hope this will be fixed soon Currently I have a small workaround for this (Klepto.CoreAdditions). Otherwise it seems very complete and nice. [Edit] found out that you can use mesh.surfaces.add([material]) as CreateSurface the standard functions should still be accessable IMHO @Rick: I believe he means extra getter / setter which are not available in the other languages because the engine.dll provided with LE doesn't offer these. The C# header uses a modified dll with much more functions. When using this sll with c++ or other languages, they can provide these features as well.
-
Don't use Entity.NullPointer, these Pointers are needed if you use the standard Pointer functions and not the OOP classes. Replace it with null or don't use it at all, it is an optional parameter.
-
Emitter fire = new Emitter() use the standard constructor.
-
Hi I hope i can help you. 1. You need to download the package from the first post as it includes all needed references like OpenTK, Leadwerks.dll etc. 2. Download tha latest version of the Control here : http://leadwerks.com/werkspace/index.php?/topic/2429-new-letkcontrol-beta/page__view__findpost__p__22982 3. Make sure you have set all References set correctly: you need a Reference to Leadwerks.dll and a reference to the 3 delivered OpenTK dlls. If you have done this, you should be able to run the sample.
-
Hi, here is my current C# Header of the gmfsdk. The Header Assembly is located in the Libs folder together with the gmfsdk dll. Also the project itself is a C# Version of one of the sdk samples. Download: GMFSDK_Header.zip
- 1 reply
-
- 1