Jump to content

Pastaspace

Members
  • Posts

    60
  • Joined

  • Last visited

Posts posted by Pastaspace

  1. After a few tries on my own, with no luck, I've decided to ask for help.

    What I'm trying to do is have a separate and smaller context/render area out on the screen. Basically anything drawn outside of the area gets cut off. So for example, drawing a 200x200 image inside of this area, if it was 100x100, would only render part of the image. I'd be using this for minimaps and similar.

     

    p29EIqn.png

    Basically this. I have a general idea of how do to this, but then again, not really.

    So what do I do? My main guess is that it involves creating and drawing to a separate buffer, but there's limited documentation on buffers.

  2. No dice, not exactly. There's a few issues.

    First, there's no diffuse+normal+alphamask.shader, only a diffuse+normal+specular+alphamask.shader

    Second, while it solves the issue of the background (which is now fully transparent) disappearing, the transparent aspects of the textures now disappear as well.

    Example.

    Probably because the shader is discarding those pixels.

    Ideally though, it should have a slight transparency for those textures, basically like this.

  3. Not being able to see your code, I am just guessing that you are assigning a simple diffuse.shader to the plane like I did in that example code. You need to assign a shader that allows for transparency and discards pixels based on the alpha value. It looks like the only inherent shader available would be the diffuse+normal+alphamask.shader. So just set the color to have an alpha value less than 0.5 for the background color and it should be discarded. Make sure when drawing your textures to increase the alpha back above 0.5.

    I've tried both the diffuse and the transparent.shader, but not the alphamask one.

    For the color, is that the material color that needs to be set, or the context color?

  4. I'm not sure if this should go in the programming or the game art section, since it seems equally split between the two sections.

    My GUI is drawn on a 3D model, as that thread shows, the way I'm doing this is drawing to a buffer and having that buffer be the texture of a plane. That works just fine, except for one thing.

    No matter what I do, the buffer background is always rendered. That is, even though it draws all the elements, it draws them on a white screen.

    Example here.

    I simply want the plane to draw my textures, semi transparent if need be, and nothing more. Having the material for the plane use the transparent.shader texture doesn't work, it's applied there and it just makes the white background transparent as well, rather than get rid of it entirely.

    My question is, what do I need to do to have it just render the textures I draw, rather than the textures + that white background?

  5. Is it possible that one can draw on a model.

    That is, normally, I would have a UI by drawing 2d images with the context object, what I want to instead is have a 3d object, a plane that displays the player's health and other attributes, that evidently updates with the relevant information. Does Leadwerks support this?

  6. What I am trying to work is out code that allows the player to use objects, in this case by pressing the E key when their mouse is over a usable object.

    Now this is done, the problem is the range. Using a pick, the camera will pick something regardless of its range to the player. So even if the button I use is fifteen miles away, it'll still activate it as long as the mouse is technically over it.

    My question is, Leadwerks 2.5 allowed us to give the pick a distance (anything past that distance was ignored basically), how do I do this in 3.2?

    tp_toPick.distance doesn't work. It always returns -1 regardless of distance.

    Basic code is here, with the action code cut out.

     

    if (window->KeyHit(Key::E))
    {
    
    if (camera->Pick(centerMouse.x, centerMouse.y, tp_toPick, 0, true) == 1)
    {
    //If things are a certain distance, perform the relevant action on the pick.
    }
    }
    

  7. I'm also getting this issue, performing a camerapick, then checking the pickinfo.distance variable, it's always -1 no matter what distance I'm at relative to the picked thing.

  8. I've done all that. This is not the actual code, merely a similar example to help demonstrate what I'm trying to accomplish. What I'm trying to do is use DrawImage and similar Context functions in a separate object. I can call anything just fine in the main body where the original context object was initialized, but cannot pass it to another object for use, this is what I'm trying to figure out.

  9. I've been working on converting my game to 3.1's engine, and I've run into a bit of a snag.

    Basically, the things that handle my inventory are separate objects, in separate files from the main Start and Loop portions. These objects also contain the functions for drawing the player's inventory (a mix of DrawImage and DrawText). However, this doesn't seem to work, and I always get an "Assert failed" error.

     

    This is a basic version of what my code is doing. In my main program, I create a context window as well as an inventory object and similar.

     

    App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}
    inventoryObject myObject;
    bool App::Start()
    {
     window = Window::Create();
     //Create a rendering context
     context = Context::Create(window);
    
     return true;
    }
    

     

     

    Somewhere in my InventoryObject's list of functions is the one that draws its image, it it passed the context it renders on from the main program. InventoryObject.cpp is, obviously, a separate file.

     

    void inventoryObject::DrawObject(Context* cc_Context)
    {
    cc_Context->DrawImage(myImage, 0, 0);
    }
    

     

    Then in the main loop, it calls this function.

     

    bool App::Loop()
    {
     if (window->Closed() || window->KeyDown(Key::Escape)) return false;
    
     Draw::SetColor(0,0,1);
     context->Clear();
     Draw::SetColor(1,0,0);
     myObject.DrawObject(context);
    
     context->Sync();	
     return true;
    }
    

     

    However, again, I get an assert fail error. Is there something here that I'm missing, or do I have to draw all my context images and text in the main program only?

  10. Basically, what the problem is is that in Marmoset and dDo, the textures applied to one of our modesl look like http://i.imgur.com/rGiWCpH.jpg in accordance to concepts and the artistic vision of the game.

    However, when attempting to convert the model into a format compatible with Leadwerks, the model instead ends up looking like http://i.imgur.com/XJ0HMrg.png.

    We believe this has to do with the way either Leadwerks or the .mat file is handling the Normal and specular maps and also the loss of a gloss map, which was integral to the look of the original concept, and can't really find a solution or decent documentation on properly transferring over such textures.

    So does anyone here know what the problem actually is?

  11. Couldn't find a good topic on this, so I'm gonna ask myself.

    Say I have a scene that I've loaded, and inside the scene I want to retrieve all of the entities of a specific type (like say, I want to get all the oil barrels for my barrel-romance simulator).

    The problem is, I can't find a place to start. How would I implement a function where I could parse a scene for all of a type of entity?

×
×
  • Create New...