Jump to content

Rastar

Members
  • Posts

    421
  • Joined

  • Last visited

Posts posted by Rastar

  1. I don't know - why not use something like the Kinect for that purpose? I don't have a Kinect 2 (only the first one), but it seems pretty good now at picking up body movement, even hand positions and facial expressions.

     

    At least I wouldn't want to spend 10 minutes or so to put on some strange straps and stuff.

    • Upvote 1
  2. If a method isn't supported in Lua, the compiler complains that you're trying to access non-existing property XY. If you get a nil mat then the call was successful, but the entity doesn't have a material. Are you sure you're calling GetMaterial() on the correct entity? self.entity will be the scene object to which the script is assigned, is that the correct one?

     

    By the way, I think calling that method will change the shadow casting for all models that use that material (even for the non-dead aliens). So maybe you should create a "Dead alien material" and assign that using SetMaterial().

  3. Just as an additional illustration: Using a (mean and inefficient) hack in the control shader, I got quad tessellation. Compare

     

    post-6662-0-15261100-1392674369_thumb.png

    Triangle tessellation

     

    to

     

    post-6662-0-68774000-1392674407_thumb.png

    Quad tessellation

     

    (both using fractional_odd_spacing). At least for my purposes, I would definitely prefer the more regular structure of the latter.

    • Upvote 1
  4. In your project, there is a folder "Shaders/Model". There is a simple Shader called "diffuse.shader" which only uses a diffuse map. In your case, with three outputs, you would probably use "diffuse+normal+specular.shader". I just wanted to make sure you're using one of those (open your material in the editor and have a look at the "Shaders" tab).

    • Upvote 1
  5. I mentioned this before, but think forgot to make an "official" suggestion:

     

    I would really love to be able to use quads as a drawing primitive, mainly for using it in tessellation - quads IMHO lead to a more evenly distributed tessellation.

     

    So something like

     

    Surface:AddQuad(index0..index3)
    

     

    which also implicitly means a

     

    glPatchParameteri(GL_PATCH_VERTICES, 4);
    

     

    An unofficial, unsupported, "use at your own risk" version would be suficient for now :)

    • Upvote 4
  6. Try importing the 16bit format (r16), that should work. Can't remember right now if LE supports the r16 extensions, if not just rename it to "raw".

     

    It depends on your vertical terrain scale if 8bit is enough, but in many cases the 256 values are a little too few - for a 1000m terrain this means a resolution of 4m. I use 16bit formats most of the time.

     

    EDIT: One thing that comes to my mind: If I remember correctly, the Basic Edition of World Machine by default generates a terrain of 513x513. So you'd have to remove that checkbox under Project Parameters to make it 512x512. Also, you have to create a 512x512 terrain in Leadwerks instead of the default 1024x1024.

  7. I'm afraid you would have to spend $249 for that experiment. I you like I can generate the meshes for you (you could define your terrain in the basic edition and send it over). You wouldn't be allowed to use them commercially, of course. Just PM me if that's an option.

  8. I would like some documentation on this as well. My guess (I have no access to my PC right now to try it out) is:

     

    Basically everything is shared between an entity and its instances, with the following exceptions

     

    1) the transforms (position, rotation, scle)

    2) the entity color (ie entitiy:SetColor())

     

    If you look in one of the vertex shaders, you'll see that the enity matrix is indexed with gl_InstanceID, so that's why the transforms are per instance. In addition, Leadwerks encodes the entity color in the fourth column of the entity matrix, so that is per instance as well.

     

    Everything else (like material diffuse color) is passed in as a uniform, so it will be shared between instances.

     

    But again, this is just my guess from the code, an official documentation on this would be nice...

    • Upvote 2
  9. As Aggror said - possible: yes, easy: no. You basically have two options:

     

    1) Use the built-in terrain and map system. Split your terrain over several maps and change the maps during run-time. You could pre-load the next map in a separate thread to reduce swapping time, but the transition will be visually noticeable, so you might need a loading screen or something like that.

     

    2) Implement a streaming terrain solution. Leadwerks currently doesn't provide a lot in that area (few engines do), so you would have to do everything yourself. For example, you could use tiled meshes arranged in a checkerboard-like pattern and load/unload them (and their contents) as the player moves.

     

    It probably depends a little on how much experience in game development you have. If you are just starting out, consider doing something smaller, otherwise you might quickly get frustrated. Otherwise - it's a fascinating journey ahead of you, but a long and twisted one.. :)

    • Upvote 2
  10. @martyj; There are a couple of questions that you should probably answer to yourself before putting work into this:

    • What is actually the "real-world" size of your terrain? If the heightmap size you have given is the number of pixels - how many units (meters) per pixel do you have? More than 1 m/pixel? Very large maps will create problems due to floating point errors far away from the origin (say, more than 16k in either direction), leading to rendering artifacts and physics problems. There are ways to counter this, but it's an additional complexity.
    • Do you really need such a large terrain? Does your game idea call for it? How fast will the player move through the terrain? How are you filling such an enormous terrain with interesting gameplay?
    • The dimensions of your heightmap are slightly unusual, normally you will find powers of two, and most often square dimensions (like 1024x1024, 2048x2048 and so on), not the least because GPUs are optimized for handling textures of those dimensions.
    • Objects (trees, enemies, houses, ...) for such a terrain can't be kept simultaneously, they will have to be streamed in and out according to player movement.

    EDIT: @MajorAF, just saw your post in the Tutorial Request thread. As far as I know, Combat Helo uses terrain tiles that are streamed in and out of memory. But that's not part of the built-in Leadwerks 2 terrain, but a custom implementation. You might ask community member "Flexman" about this, he's one of the authors. But again, all of these large terrain solutions are hand-crafted and don't come with the engine.

  11. Ah,

     

    it seems GetSurface() is not available for an instanced model. So

     

    local model = Model:Create()
    model:AddSurface()
    local surface = model:GetSurface(0)
    

     

    run fine, but the following

     

    local model2 = model:Instance()
    local surf2 = model2:GetSurface(0)
    

     

    gives the described error.

  12. What are the exact steps to manually set an AABB? Since my mesh patches are displaced in the shaders, the automtically calculated ones will be wrong. I was thinking along these lines:

     

    local aabb = mesh:GetAABB()
    aabb.min = Vec3(minx,miny,minz)
    aabb.max = Vec3(maxx,maxy,maxz)
    aabb.Update()
    

     

    Would that work? Do I have to call any of those entity:UpdateAABB() methods afterwards or will this destroy my manual setting?

  13. Yes, and for seeing procedurally generated stuff in the editor. I am creating meshes in scripts, and 1) I see the result only when running the game, and 2) only see it shaded, but I would prefer wireframe mode to see if the structure is correct.

     

    There are also many applications I'm thinking of where I would like to be able to draw a path in the editor using some gizmos, and then create something along that path, e.g. extruded geometry (roads), or make something follow that path (e.g. a camera).

×
×
  • Create New...