Author Topic: Helping with DB3  (Read 3538 times)

Offline Tj3

  • Bot Neophyte
  • *
  • Posts: 39
    • View Profile
Helping with DB3
« on: May 31, 2012, 10:39:52 PM »
Hi, something the other day reminded me of Darwinbots, and I figured I'd come and see what was going on. Haven't been on this site in over a year... It seems like DB3 is still being developed (although the forums are pretty quiet), so I'd be interested in helping out. I contributed some shader code for bordered ellipse drawing or something a little over a year ago, but I don't remember how stuff was set up. I'm not sure how to get the code, my SVN client is asking for a password to checkout from svn.darwinbots.com/Darwinbots3. I had thought anonymous read-only access was possible. I've gotten quite a bit better at coding since I was last here, doing quite a bit in C# and Java. Did a bit of XNA stuff, including 2 Minecraft-style terrain tests, which helped with learning about some 3d stuff and a lot about shaders and HLSL. Anyway, if you could respond and tell me how to access the repository, and what I should work on, that'd be great. :)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping with DB3
« Reply #1 on: June 01, 2012, 04:11:44 AM »
Welcome back :)  Yeah, still chugging away at the code.  I've worked a bit on the graphics module, so it's further along than when last looked at it, but it's not finished (maybe 50% or so).

You should be able to get the repo checked out anonymously.  It seems to work through the web browser at least (svn.darwinbots.com/Darwinbots3  It's case sensitive).  Also, which SVN client are you using?

...

Actually I have a task that would save me a lot of effort, and you seem to have some background in it now so even better :).  I'm about 60% through an upgrade (sidegrade?  Port I guess) from XNA to SharpDX (which is a simple wrapper around DirectX).  XNA has made me grumpy enough that I've decided to ditch it and go straight for proper DirectX.  SharpDX is a purely managed wrapper for DirectX; it should solve a number of minor annoyances.

I've got the main graphics module working with SharpDX.  There's a unit testing project for the shader code that's not upgraded, though.

Modules/Blacklight is the graphics module.  There's a Blacklight.SharpDX9.sln solution file.  If you start that up and run Blacklight.Testbed, you should see a few ellipses and rectangles.  You can pan the camera with the mouse, and zoom with the mouse wheel.  The testbed is set up to use different adapters.  If you've last compiled Blacklight.XNA, it'll use XNA.  If you last compiled Blacklight.SharpDX it'll use SharpDX.

Speaking of, there's also a Blacklight.XNA.sln solution.  I'm pretty sure everything in Blacklight.XNA was ported over to SharpDX, but non of the unit tests were.  So one task would be to look at the Blacklight.XNA.UnitTesting project and copy over the shader tests.

The shader testing framework uses XNA still.  There's a few issues with this (the shader compiler for XNA is apparently stuck in the stone age, for one), so the other task would be to port the Modules\UnitTestSharp\UnitTestSharpHLSL.sln solution over to SharpDX.  XNA maps pretty closely to DirectX, except in a few places, so it's not a difficult task but it's not exactly code monkey work either.  If you could get UnitTestSharpHLSL to not rely on XNA at all anymore, that would make me happy :) 

SharpDX lives in 3rdParty/SharpDX.  There's a lot of XML comments for the binaries, so you'll want to unzip the comments.zip file.

And last, I have no idea about things like DirectX memory pools and such.  I have no idea if the way I've set up DirectX is proper or not.  If you could go through the DirectX API calls and sanity check them against the MSDN documentation to make sure they're use makes sense that would be great.

Once that's all done, we need to hook up the polygon stuff I'm working on right now to the graphics engine.  And clean up the triangle draw primitive shader code, since I left it in a mess.  Then work on how to draw lines, and then it'll basically be feature complete enough for me to move on to other parts of the program.

...

Anyway, sorry for the wall of text.  Let me know if you have any questions along the way.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping with DB3
« Reply #2 on: June 04, 2012, 04:09:19 PM »
Quote
XNA has made me grumpy enough that I've decided to ditch it and go straight for proper DirectX.

This sounds interesting. What happened???

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping with DB3
« Reply #3 on: June 04, 2012, 05:42:30 PM »
It doesn't play nicely with .NET 4.  It doesn't look like that's going to change soon.  It has to be compiled against x86.  Which means all my executables need to be x86 instead of Any Cpu, which is a pain.  And the shader compiler is apparently one from years ago that has some annoying bugs in it.  Microsoft might fix these issues eventually, but it's just a million times easier to use DirectX directly.  Managed wrappers in the past weren't great, but SharpDX fixes enough of the issues to make it an attractive option.