Hi!

I released a new build a few days ago, this time featuring an actual in-game module being rendered by the actual in-game module renderer! There was a lot of behind-the-scenes work involved in this, and I’ve never built anything like it before, so I’m incredibly relieved that it works.

firstheartingame

Build #8, right here. Clicky clicky!

 

The renderer uses Multiple Render Targets, or MRTs, which are a new feature in flash. They are pri-tee cool. Now when I draw a screen full of modules I can render out an image showing their diffuse colours (what colours are painted on them), an image showing their lower frequency circular harmonic light radiance (how much light hits each pixel from every direction), and an image showing their higher frequency circular harmonic light radiance (more detail for the lower frequency stuff). Here are some pictures!

deferreddiffuse

Diffuse

You can see here that I haven’t actually painted the command module yet – it’s just flat white, so everything you see in game is lighting detail

 

deferredchlow

Radiance low harmonics

I might be using the word “radiance” incorrectly. I’m pretty new to all this!

 

deferredchhigh

Higher harmonics

It’s not really obvious what’s happening here, but trust me it’s cool and useful.

 

deferredaccumulation

Accumulation buffer

This is where all the lights are added together. Since light brightness isn’t proportional to pixel value, this looks a bit funny until…

 

deferredfinal

Backbuffer

This shows the accumulation buffer translated to pixel values, and is what finally appears on screen. Pretty!

 

So, what’s the point of this? The point is lights. Many, many, many lights. Lights from thrusters, lights from muzzle flashes, lights from explosions, and lights from missiles and torpedoes and laser bolts. With this information stored in buffers already it becomes incredibly efficient to draw lots of little light sources, which should be perfect for a game like this, and would have been impossible with regular forward rendering. I, uh, don’t actually have any of these lights in the game yet, but I expect they’ll look awesome. PEW PEW!

I ran into quite a few issues getting this working, mostly due to a an apparent absence of documentation. I couldn’t find a single article from Adobe about how this works, so had to cobble together an understanding via other people’s source and hours of trial and error. If you’re also looking to use the new flash MRT feature you might find these notes useful:

  • MRTs are only available in Context3DProfile.STANDARD, which you pass as a parameter when you requestContext3D
  • setRenderToTexture has a new parameter colorOutputIndex, which you set to 0, 1, 2 etc for each of your targets
  • Each target used in a single draw must have the same texture format
  • Your pixel shader should output to each of the targets, using registers oc0, oc1, oc2 etc to reference them
  • Older versions of the AGALMiniAssembler won’t recognise oc0, oc1, oc2 etc. I couldn’t find an official Adobe source for this file but found a more recent version here
  • If you render to any other textures later, first call setRenderToTexture with a null target for each colorOutputIndex you are no longer using

I hope this helps someone out there.

<3
Farbs


24 Comments » for The Dawn Star – Build #8, MRTs
  1. Dave says:

    Hi Farbs, I just went into this new build and I couldn’t see my command module at all! Is there a fix for this?

  2. Farbs says:

    Hi Dave!

    Are you using chrome? It turns out chrome isn’t supporting the new render features very well just yet. I found this info in the comments on another article:

    http://nekobit.puslapiai.lt/deferred-renderer-online-demo/

    1.visit chrome://flags
    2.search d3d11 and click “enable”
    3.restart chrome
    4.visit chrome://gpu and check if GL_RENDERER becomes d3d11
    If it still can’t work, I don’t know how. Maybe you can ask chrome why your hardware can’t open d3d11.

  3. Ron says:

    Chrome maintains its own GPU and GPU driver whitelist, at least for WebGL but probably for everything to do with graphics. If you aren’t having any success, try updating your graphics drivers. It might also be worth trying the same code in Chrome Canary (to at least see if a recent fix is eventually on its way to regular stable Chrome).

  4. tony says:

    Hey, nice work. I have no problem viewing the new command module. Looks awesome! I did notice that it lags much more than before. I’m using firefox and latest flash. Although adobe flash did cause me trouble in the past and I suspect it’s because it hates my graphics card.

    I do hope that you add an option to turn off the new rendering system and use the retro system. Nice graphics are good, as long as it doesn’t hinder the size of my ship :)

  5. Capt. Bradley says:

    The command module is completely invisible on my browser. Using latest chrome and flash.

  6. Farbs says:

    Hi Capt. Bradley – yeah, it looks like Chrome is being quite picky about what video cards it lets use what features. If you check out my earlier comment you’ll see some instructions for working around this. Hope that helps!

  7. Capt. Bradley says:

    That didn’t work :^(. I guess Chrome just isn’t for this game, first the zooming not working in fullscreen, now invisible modules.

  8. William says:

    Farbs,

    Let me just take a moment to tell you how excited I am for this game. I’m been a fan since captain forever and been regularly checking for Jameson updates. I guess it’s been a little while since I last looked, but imagine my surprise to see Dawn Star, the reboot and continuing releases.

    Ok, some gameplay feedback –
    About 4 hours playtime, wasn’t able to find any lances. Couldn’t find the beacons, and yes, I was looking. Would love to find an oxygen tank. Great new engines !

    Anyway, keep up the good work and looking forward to build #9.

  9. Edward says:

    Hey there, Farbs! I’ve been a follower of the Jameson, sorry, Dawnstar series for a while and I had a few comments. Firsly, I was wondering if there is any way to fix the lag that the new module is causing and, secondly, I was also wondering if you will be adding a visual for the starting laser. Thank you, Edward.

  10. Flamboyant Mongoose says:

    Hey there Farbs!

    It’s been a terribly long time since you’ve posted any updates on Captain Jameson! I know you’re having some difficulties deciding how you want to communicate with us; but it seems to me that this is still your best option. The forums are exceptionally difficult to find through the site–and indeed I’ve actually yet to ever find them, except by doing a search on Google.

    That all said, I hope we get some news soon on how the new look of the game is coming along! Please consider making weekly blog postings again and skip the video portion because that was obviously too time consuming.

    And please keep up the great work!

  11. Chris K says:

    I’d settle for monthly even. But then again, this is nothing new if you’ve been around for a long time.

    Developing games as a one man team has got to be rough, and I don’t envy anyone who does it. Sure, you get the creative control you want, but progress is going to be slow, resources are limited and your attention rarely can be focused on one thing at a time.

    Personally I guess I’m just happy to know that The Dawn Star/Captain Jameson is not dead in the water.

  12. Farbs says:

    Hi! You’re right, I’ve been quiet for quite a while now. Sorry about that!

    What happened was:

    1) I got bogged down trying to create new art for the modules. Trying to integrate module colours without making them look like rainbows was, uh, pretty tricky. I have some new ideas to try though so will hopefully make more progress when I get back to it.

    2) I landed back on Card Hunter, and ended up there quite a while longer than I expected. I’m currently working on adding co-op to the campaign, which should be pretty awesome. I have it working in battles already, however re-wiring all of the campaign progression logic is a bit of a nightmare, and is taking longer than expected. Once that’s done I expect to be back on TDS full time, and will start posting updates again.

    See you back here soon!

  13. Hayden says:

    “See you back here soon!” 21 days later….

  14. Chris K says:

    I’m sure reworking every single module in the game and refining a brand new art style is no small undertaking, especially for someone who has multiple projects.

  15. Hayden says:

    17 more days later…

  16. Farbs says:

    Yeah, this CH work is a real nightmare. I’m still working on it. In the mean time, have you seen how Captain Forever Remix is shaping up?

    http://captainforeverremix.com/

  17. Chris K says:

    Okay, fair enough.

    (I apologize for the rambling that follows)

    But it’s not like Farbs has any personal to any of us to get this done in a timely fashion, and getting frequent updates won’t make it come out any faster either.

    Clearly he has his own vision for how this thing is going to turn out and his own reasons for making it, and that’s really the way it ought to be when you’re making games. Maybe now is just not the time for communication or user feedback.

    I completely understand the desire for updates, and I’m not even sharing I don’t share in it. However, at the end of the day either the game gets finished or it doesn’t. Either patience will be rewarded or it won’t. Whether we get regular updates today isn’t going to matter a few years down the line, and being impatient certainly doesn’t help the situation.

    At the end of the day all we can reasonably hope for is that we get a great little game at the end of the line. There are plenty of other games out there to play in the meantime, so just let yourself be distracted for a while. You can always come back later- there’s no need to focus too much energy on this one thing.

    Regular updates are just a nicety, not something to be expected. I mean, look at what the Black Mesa team did; they were virtually silent for years and they ended up shipping an awesome remake of Half-Life in the end. The wait is frustrating in the moment, but whatever you get at the end is always going to be there.

  18. Hayden says:

    Well this is fun

  19. Chris K says:

    Hey Farbs, I’ll buy someone a supporter account if you post a new screenshot or something.

  20. Chris K says:

    Damnit, it worked.

    I mean… yay it worked!

    Love you, Farbs

  21. Avior says:

    Dear Captain Farbs,
    The command module is invisible. I am using Firefox, not Chrome. Go figure.
    Sincerely,
    Captain Avior

  22. Avior says:

    P.S.: Solar arrays are NOT, repeat, NOT invincible.

  23. Robert K says:

    Came back to the game, looks awesome. Great job on the progression, the oxygen station spacing combined with boosters for crossing space is creating a nice flow, especially with the mini-goals of charging to the nearest SOS when you wanna go to a higher difficulty.

    I’ve come across a bug, which is the game starting in a smaller window, then the intro zooms out to the defined (via the [-] SCREEN SIZE [+] buttons), but then the game starts in a small window. I’m using chrome. Not sure if this has already been reported, do you have any kind of bug tracker?

    Do you have any plans for a minimap/mini-nav? I tried explaining what I mean but it was easier just to make a gif: i.imgur.com/hEAEJBX.gif

    Can’t wait to see how the lighting effects you’re working on turn out.