Jump to content

Lunarovich

Members
  • Posts

    166
  • Joined

  • Last visited

Posts posted by Lunarovich

  1. One danger with the 'simple' approach Josh, could though be that LE ends up i just another FPS-creator, so watch out for that and don't throw away your graphic skills to much. LE must be better than the existing simple game creators although it doesn't have to compete with the big ones.

     

    I agree with this one totally. As far as I can see, LE users are more or less computer graphics savvys that like to do things in a simple way. This things include low level as well as high level aspects. An LE is nice because you can do low level and high level model or texture manipulation. For me, this is the most important aspect of LE and a reason I'm using it.

     

    Another nice thing is that a swinging door, for example, does not come as a black box, but as a model with a script attached - a script that you can read and modify to your likings. My point is that something like a swinging door is not built into LE. Rather, it's easily constructed thanks to LE's design.

     

    OK, sorry for not talking about PBR and SD. An SD support would be a really nice thing and would not harm the aforementioned design principles. On the other hand, for people that want rather simple but powerful way to create procedural textures, there is an excellent free NeoTextureEdit. Unfortunatelly, it seems to be no longer developed. Nevertheless, I use it all the time for my textures.

  2. As what regards execution, from my experience, it's sometimes possible to execute a file on the NTFS partition and sometimes it's not. For example, I was able to run a LE game executable on an NTFS drive in Linux.

     

    P.S. The reason I was using NTFS was having a dual boot. I needed to store files on the partition that's accessible both to Linux and Windows. An Ext4 partition is invisible, as if it was inexistant, in Windows.

  3. I'm running LE on Ubuntu with AMD driver. Now, I have 2 issues, a minor and a major one.

     

    Firstly, VSync does not seems to work (yes, I've set Context:Sync(true)).

     

    Secondly, when I start LE after rebooting, it's quite fast. I get around 90 fps with water included on simple maps. Quite satisfactory. However, after a LE restart or two (or after a longer session without a restart), I get around 35 fps even when there are no objects in the map. The only solution is to reboot a computer.

     

    Any ideas? Thanx!

     

    EDIT This happens when I plug in external monitor to my laptop regardless whether the build in monitor is turned on or off. When I use only lap top's build in monitor, the situation does not seem to happen. Needless to say, I want to be able to use my 24 inch monitor.

  4. Well, I understand and approve the idea to go for the simplicity and the most common use cases (the post-processing, here).

     

    However, I like LE precisely because it manages to couple simplicity with generality. A vertex manipulation (normals, uvs), for example, gives us a low level access to the mesh and empowers us to do wonderful things with a procedural geometry. And yet, it's very simple to use.

     

    Likewise, I use buffers for procedural textures. I generate a texture directly in a custom shader (insted of using Context's Plot function) and render it to the buffer. For example:

     

    -- Save the ref to the current shader & buffer.
    local context = Context:GetCurrent()
    local defaultShader = context:GetShader()
    local defaultBuffer = Buffer:GetCurrent()
    
    -- Specify a TEXTURE size.
    local textureSize = 128
    
    -- Although we can use Context::Plot,
    -- we rather use the custom SHADER to draw a texture in the GPU.
    local customShader = Shader:Load("Scripts/Custom/drawimage.shader")
    
    -- Create a custom BUFFER to draw a texture to.
    -- static Buffer* Create(const int width, const int height, const int colorcomponents=1,
    -- const int depthbuffer=1, const int multisamplemode=0);//lua
    local customBuffer = Buffer:Create(textureSize, textureSize, 1, 1)
    Buffer:SetCurrent(customBuffer)
    
    -- must be called after Buffer:SetCurrent()
    context:SetShader(customShader)
    
    -- DRAW the texture and store it in the local variable.
    --context:SetBlendMode(Blend.Alpha)
    local texture = customBuffer:GetColorTexture(0)
    context:DrawImage(texture, 0, 0)
    
    -- Restore previous buffer and shader.
    Buffer:SetCurrent(defaultBuffer)
    context:SetShader(defaultShader)
    

     

    I would be very disappointed to see the possibility to do something like this removed, only because the use of buffers was meant as a hack to enable post-processing.

     

    For me, the possiblity to directly manipulate buffers is as essential as a possiblity to directly manipulate vertices.

    • Upvote 1
  5. I've started a project in Windows and the project is on the NTFS partition. Other modifications do get saved.

     

    EDIT: It's definitely a NTFS partition issue. Linux version of LE cannot handle it. On the ext4 partition, scripts get attached as expected.

  6. I'm using the Ubuntu distribution of Linux. Everytime I try to attach a script to an object via the editor, the script appears to be attached and I save the map. When I select another object and select the object in question again, there is no script attached anymore. Likewise, the runtime completely ignores the script.

  7. Emacs has quite steep learning curve. I've been using it for various purposes for years now. If you want some quick and decent solution, I can only recommend Atom.io

     

    It's a modular editor based on package system. There is a nice package for Lua (you install it from the editor) which does syntax highlighting and auto-indentation. There are also packages for auto-completion and similar programming necessities.

    • Upvote 1
  8. Sorry to bump this up, but I can't find nowhere a clear answer to this question:

     

    Is it possible to publish a game for Mac OS X at the moment?

     

    As far as I can see, it was possible to do it before. But can I do it now, with a current LE version?

  9. I'm using Emacs. With settings that I've made, I have the following features:

    • Auto-complete. I've added a custom-made dictionary file with LE classes and methods.
    • Lua snippeting. I've made several snippeting templates - for generic loops, method definitions, etc.
    • Syntax highlighting and auto-indentation. The latter is very, very useful: it's enforced and you can easily detect missing construct parts.
    • On the fly syntax error checking - so that even before running a LE game, I can tell if there is anything obviously wrong with my code.

    Plus, in the opposite window, I'm always keeping open a Lua console, so I can easily test various LUA constructs I'm not sure about.

    • Upvote 2
  10. Leadwerks recently changed the way the application starts. The entry point of the game was App.lua. Now it's Main.lua. API doc does not yet reflect that change and continues to give examples using App.lua.

     

    That said, you can simply create an App.lua (named exactly that way) script in Scripts folder (should be exactly in that folder) and copy paste examples from API doc pages. They should work instantly. Namely, if LE finds App.lua, it treats it as an entry point for your game, for the backwards combatibility sake.

     

    Anyway, create App.lua file, copy paste example in it and you should be fine for now. You can tweak the examples in order to understand better how LE works.

     

    Hope that helps...

  11. Thanks for this clarification. Then again, models shouldn't be selected by default... And their selection state should not be reflected in any way during the runtime...

     

    Anyway, in the default shader, for example, in the vertex part, I see these lines:

     

       ex_selectionstate = 0.0;
       if (vColor.a<-5.0)
       {
           vColor.a += 10.0;
           ex_selectionstate = 1.0;
       }
    

     

    As far as I can see, the alpha value of the entitymatrix[3][3] (I refer to the entity.matrix[gl_InstanceID]) encodes the selection state of the object. Am I right? I mean, vColor.a is fed with value via

     

    vColor=vec4(entitymatrix[0][3],entitymatrix[1][3],entitymatrix[2][3],entitymatrix[3][3]);
    

     

    So, here comes the puzzling part. If this value is less than -5, than we add 10 to this value. Why do we want to change it? I see that ex_selection "boolean" gets the value of 1, which I understand (or I think I understand).

     

    Anyway, in the fragment part of the shader, one can read this:

     

       int materialflags=1;
       if (ex_selectionstate>0.0) materialflags += 2;
       fragData2 = vec4(0.0,0.0,0.0,materialflags/255.0);
    

     

    According to this post, material flag 1 stands for ligthing enabled and 2 stands for decals enabled (reserved; btw, why reserved? what does it mean?). So, if we add 2, material flag will be 3. What does it mean for materialflags to be 3? And finally, if we divide materialflags by 255, even when it's 3, we'll have a value so small that it is barely (if at all) visible to the human eye. What's the point in all this?

  12. Thank you! Finally, the problem was in fragData2. Here is a version of the fragment shader that gives correct results:

     

    #version 400
    
    // Outputs
    out vec4 fragData0;
    out vec4 fragData2;
    
    void main()
    {
       fragData0 = vec4(0.0, 1.0, 1.0, 1.0);
       fragData2 = vec4(0.0,0.0,0.0,0.0);
    }
    

     

    According to this post, fragData1 stands for normals and specularity, and fragData2 encodes emissivity and something called material flags. As far as I can see it, my material was, for some reason unknown to me, emitting the red "light". I've turned it off by setting every value of fragData2 to 0.0.

     

    I've made some tests with fragData2 and it does affect the final color of the model. What I see as a design flaw is this: if you do not specify some color value and material needs it for some reason, the default value should be set to no particular value (black in our case) or to some neutral value (white, in the case of tinting, for example). The default value should not be some idiosyncratic color like red.

  13. Hello! I have this minimalistic quad model:

     

    local model = Model:Create()
    local surface = model:AddSurface()
    
    surface:AddVertex(-0.5,-0.5,0, 0,0,-1, 0,0)
    surface:AddVertex(0.5,-0.5,0, 0,0,-1, 1,0)
    surface:AddVertex(0.5,0.5,0, 0,0,-1, 1,1)
    surface:AddVertex(-0.5,0.5,0, 0,0,-1, 0,1)
    surface:AddTriangle(2,1,0)
    surface:AddTriangle(0,3,2)
    
    surface:UpdateAABB()
    model:UpdateAABB(Entity.LocalAABB)
    model:UpdateAABB(Entity.GlobalAABB)
    

     

    In order to shade it, I create a simple material and give it my custom minimalistic shader. Here is the vertex shader

     

    #version 400
    #define MAX_INSTANCES 256
    
    //Uniforms
    uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity;
    uniform mat4 projectioncameramatrix;
    
    //Attributes
    in vec3 vertex_position;
    
    void main()
    {
    mat4 entitymatrix = entity.matrix[gl_InstanceID];
    mat4 entitymatrix_ = entitymatrix;
    entitymatrix_[0][3]=0.0;
    entitymatrix_[1][3]=0.0;
    entitymatrix_[2][3]=0.0;
    entitymatrix_[3][3]=1.0;
    
    vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position, 1.0);
    
    gl_Position = projectioncameramatrix * modelvertexposition;
    }
    

     

    And here is the fragment shader

    #version 400
    
    // Outputs
    out vec4 fragData0;
    
    void main()
    {
    fragData0 = vec4(0.0, 0.0, 0.0, 1.0);
    }
    

     

    Now, you should notice that I do not give any special color to the model, material or vertices, and that I set fragData0 to black, so normally, it should be black (and since the background is black also, it should be invisible in this particular case). However, it is red:

     

    Lq5Zq3L.png

     

    If I change the relevant line of code to, e.g. fragData0 = vec4(0.0, 1.0, 0.0, 1.0); I get a greenish mix of green and red:

     

    SQ6qczZ.png

     

    Or with fragData0 = vec4(0.0, 0.0, 1.0, 1.0); I get purple, as expected...

     

    Dq8Uu4M.png

     

    How can I get rid of this basic red tint? Why is it there in the first place?

     

    Thank you!

×
×
  • Create New...