Search Results

Search found 3 results on 1 pages for 'raptormeat'.

Page 1/1 | 1 

  • How can I link to callback functions in Lua such that the callbacks will be updated when the scripts are reloaded?

    - by Raptormeat
    I'm implementing Lua scripting in my game using LuaBind, and one of the things I'm not clear on is the logistics of reloading the scripts live ingame. Currently, using the LuaBind C++ class luabind::object, I save references to Lua callbacks directly in the classes that use them. Then I can use luabind::call_function using that object in order to call the Lua code from the C++ code. I haven't tested this yet, but my assumption is that if I reload the scripts, then all the functions will be redefined, BUT the references to the OLD functions will still exist in the form of the luabind::object held by the C++ code. I would like to be able to swap out the old for the new without manually having to manage this for every script hook in the game. How best to change this so the process works? My first thought is to not save a reference to the function directly, but maybe save the function name instead, and grab the function by name every time we want to call it. I'm looking for better ideas!

    Read the article

  • Possible / How to render to multiple back buffers, using one as a shader resource when rendering to the other, and vice versa?

    - by Raptormeat
    I'm making a game in Direct3D10. For several of my rendering passes, I need to change the behavior of the pass depending on what is already rendered on the back buffer. (For example, I'd like to do some custom blending- when the destination color is dark, do one thing; when it is light, do another). It looks like I'll need to create multiple render targets and render back and forth between them. What's the best way to do this? Create my own render textures, use them, and then copy the final result into the back buffer. Create multiple back buffers, render between them, and then present the last one that was rendered to. Create one render texture, and one back buffer, render between them, and just ensure that the back buffer is the final target rendered to I'm not sure which of these is possible, and if there are any performance issues that aren't obvious. Clearly my preference would be to have 2 rather than 3 default render targets, if possible.

    Read the article

  • When should I clear an auxilliary render target?

    - by Raptormeat
    I'm using a few different render targets in my game in addition to the back buffer. These other render targets are only used in a few places, for specific tasks. I'm wondering when I should be clearing them. Right now I clear all of my render targets at the beginning of the frame, and it seems like I'm waiting for all the textures to clear before the rest of the drawing gets underway. Would it be more efficient to clear these textures later in the frame, when they aren't being used? Is there any hope of the GPU sort of clearing them "on the side" while unrelated rendering is happening? Or are these tasks always sequential and will I always need to wait for clearing?

    Read the article

1