Jump to content

Josh

Staff
  • Posts

    23,269
  • Joined

  • Last visited

Blog Comments posted by Josh

  1. Tyler, I learned a lot from your initial design. I promised someone (can't talk about it) I would implement a simple GUI for them, and they wanted very simple text-based buttons. This got me thinking about the functionality more than the graphical look of the GUI. Your technique of using a single function for drawing the beveled boxes was where my "frames" idea came from. Before that, I was just hard-coding the vector-based drawing code for every single control! :D

     

    Your initial work was valuable because it revealed the different issues we would encounter. There's no way we could have predicted all those interactions without going out there and trying to implement all kinds of controls, and seeing what the issues were once we started actually using it. For example, the combo box problems you ran into made it clear that draw and event ordering needed to be built in at the lowest level. As a result, I found I could get desired behavior by moving controls to the end of the parent's list when they were activated, so they were rendered last. I also found that by reversing their order for selection, I could always select the topmost item.

     

    I don't think any of us could really have predicted all of that from the start, but you did the research we needed. Now we know, and a lot of your existing code can be copied and pasted into this system, too. ;)

  2. Yes, there is a callback function for events.

     

    Or in the case of a combo box it has a textbox, button, and list box control that make it up. So basically you are making a control based on 3 other controls. GUI programming is really fun, but it can also get really involved.

    Droplists (my version of comboboxes) are done. I had to add a "Move to back" function to move the list to the back of the queue, so it gets rendered last, on top of underlying controls. The code finds the active control in reverse of drawing order, so the top-most rendered item is selected first. One common programming problem is when you have drop lists that appears in front of buttons, and the GUI pushes an underlying button when you click the list. Well, I think that issue has been solved in a good way.

     

    I am paying more attention to the underlying logic and functionality than to the graphics of it. I figure the graphics are easily replaceable, but the functionality needs to be very solid. The whole hierarchy and draw ordering stuff is a lot harder to write than simple behavior, so that is what I am focusing on. If the foundation is solid, then people can easily add their own items without running into problems.

  3. No, you would not have enough video memory or texture bandwidth.

     

    Directional lights are very specialized because you cannot possibly make a texture big enough to shade the whole scene, with a decent resolution. The whole challenge of directional lights is to use more pixels in the foreground and fewer in the background. The two main ways of doing this are to have several renders of the scene at different resolutions, or to render the shadow with a skewed matrix that uses more pixels closer to the camera.

     

    There's little I can do to optimize directional lights, as they are very much a brute force technique. Far Cry 2 seems to use a skewing technique that doesn't seem to have visual errors, but of course they are going to go to great lengths to hide any errors their technique produces by not using certain sun angles. If I can devise a decent skewing technique, it could mean one shadow render of the scene instead of three, but I am not sure I have ever seen an error-free implementation.

     

    ..i guess, its still available option to turn off/on shadows from light source(point/spot) regardless this new approach taken..

    Yes, but you have some additional options that will produce real time shadows at virtually no cost.

  4. Maybe. This is the kind of optimization you can't really predict ahead of time. You just have to start using the system, find the bottlenecks that arise, and then solve them.

     

    The best part of this is you get proper six-sided point light shadows, at a cost that is similar to hacks like the dual parobaloid technique, without the visual errors.

  5. Directional lights usually have to be recalculated every single frame, because the camera is usually in motion. One technique I want to try with directional lights is one of those skewing techniques. They are glitchier than cascaded shadow maps, but if something with reasonable results can be implemented, it will only require one render of the scene, instead of the three that CSM requires.

  6. Normally you think of baked lighting as, you have a long processing step that is done before the game runs, then you display the results and it is fast. You think of dynamic lighting as, okay, it will be slow because it has to update each frame, but it looks good. It's interesting that our approach has turned into, "display the results each frame, and only update it when it is absolutely necessary".

  7. One of the most frequent requests I consistently hear is that people want a visual interface for everything. I personally don't think stuff like that adds much value to the engine, but all the artists feel otherwise. Sometimes you have to deliver what the market wants, not what you feel like doing. It won't take too long to do, and it does make the editor feel a lot nicer.

  8. My advice is to make the routines based on their hierarchy. If there are ten windows onscreen, each with one button, you should only have to evaluate one button when the mouse is clicked. For both drawing and mouse input commands, the routines should be designed like this:

     

    Method Update(x,y)

    if not self.hidden()

    if x>self.x and x<self.x+self.width and t>self.t and t<self.t+self.height

    for child=eachin self.kids...

    child.update(x,y)

    next

    endif

    endif

    endmethod

  9. To make a game for the consoles, you need to be approved by MS or Sony. To get this, you must already be an established game house with one successful title under your belt. It's much easier to get a game approved for sale on Steam. As I have pointed out before, Penumbra is the best example to model your plan after.

     

    So even if our engine was offered on the consoles at this time, it is unlikely anyone here would be able to use it.

×
×
  • Create New...