Wednesday, 29 January 2014

Hey good lookings, what's cookings?


Meshes. Meshes are cooking. Through the power of my new meshcooker app. The meshcooker implements my Application Interface and is instantiated instead of the game by command line switches to cook assets into a preferable format.

Here is the backstory: All of the new mesh import work (for certain values of "new") operates through a set of iterators that go over each vertex and triangle to smooth and flip normals to make the mesh look as good as possible. There are some meshes it can't process as it operates on shared vertices and shared edges, but for most convex hulls it works just fine. And thankfully most injection moulded plastic forms a convex hull...

The upside is that most LDR mesh files are loadable, which increases the available brickset from the basic bricks, plates and roof bricks I have to a wide array of brick elements. The unfortunate consequence is each mesh is post processed every time its loads, which leads to ~very looooong~ startup times.

So I've taken the process offline and written a mesh cooker that opens LDR and OBJ mesh files, builds a triangle set and post-processes for smoothing. Finally it converts them to a renderable vertex buffer format and serialises to disk as a bytestream.
The mesh resource bytestream can be loaded directly into a vertex buffer and startup times are now faster than ever!

The mesh resource bytestream also includes data sections for resource ID and version numbering so the mesh cooker can be automated to refresh when new or updated content is added.

I don't have much code to show-and-tell, nor any new screenies, at least not yet, but its only a few steps away from importing a whole bunch-a-bricks from online LDR resources. The code makes heavy use of the existing Mesh Import pipeline, and just derives a new Import and Export pair from the current MeshImport and MeshExport interfaces.

Tests are thin on the ground, but I'll add a few to ensure that the Import/Export implementations are symmetrical and go from there.

More news as it breaks. Recreational Programming is a lot of fun, if you have any questions or comments about game development or the Pioneer project let me know!

Monday, 12 August 2013

Triptych


The three camera controllers and input paths are working. Here is a composite shot of the a scene that I took with all three cameras.



  • On the left, the scene with my build camera which you can use to spin the scene and move a 2D cursor to add and remove bricks.
  • In the middle, a "minifigs-eye-view". This is a first person view from the minifigs perspective showing what he sees. You are free to walk around the world as a minifig.
  • On the right my third person "adventure" controller where you can see your character and explore the environment. This out-of-body experience lets you control the minifig like a traditional game character.


I've bound F1, F2, F3 to switch between them while playing which is good enough for now.

There is still a little more work before a public build is ready. The new cameras, camera controllers and input controllers are all wired together using manual dependency injection and while the scene is still a directed acyclic graph I'm worried that it would be difficult to do in a clean factory so I think a code review is in order.

The build palette is pretty rudimentary, with only a half-dozen bricks in that I've been testing with but it should be trivial to include most of the basic bricks, plates, tiles etc... that I had in the prototype and the new LDR importer should mean adding custom bricks is reasonably quick and painless.
I need a mesh cooker - this has been on the backlog for a long time. I'm currently importing OBJ and LDR meshes on startup but a really quick mesh serializer would be much better. Now I'm doing small iterations, the import time is really starting to annoy me.

Other than that, there are a few misc tasks to address, including some visual glitches that are going to bother me if I don't take time out to address them, including the difference in shadow depth precision on nVidia and ATI hardware (yes. that's still broken) and adding more config options for the render quality.

Comments and questions about Pioneer, programming or game development welcome - I'm thinking of doing an Q&A blog post to answer a bunch in one go.

So until next time, keep building!



Wednesday, 7 August 2013

Brick by Brick


Now the third-person controller works, I'm integrating it with the previous first-person and the free camera mode from my Mesh Tool/Import application.  Along with the improved build UI, the game will soon be back together and I'll be pioneering in a new tiny world to run and jump around.

There are still a couple of bugs, and rendering issues to resolve, but it totally feels like I'm on the road to a new public release now.

Code wise, there isn't much too the new camera/camera controller works.  The input and camera stacks are now both trees, with the Game Input responsible for switching different input policies in and out, and for switching different cameras and camera controllers in and out at the same time.

There is a slightly weird C++ workaround in my camera hierarchy because of the reference counted pointers I am using, but I'll either fix it or declare "No Fault Found" and move on.

My reference counted pointers are built on incomplete types, and point toward concrete implementations. However I ended up with a public method on a camera subclass that doesn't belong in the interface. Conundrum.
I'll revisit the problem before long, and the workaround doesn't create any cyclic dependencies or garbage collect problems, but its no longer code I can be proud of which is a non-trivial problem.

Usually I can sleep on problems like this, and it all comes out in the wash during review. Which seems like a reasonable plan this time too.

Until next time, think inside the box!

Sunday, 4 August 2013

Let there be life!


Its one small step for man, one giant leap for a minifig! Since all of the heavy lifting was done, I thought I'd take a break from technical tasks and do something visual...
...Its pretty satisfying to run a minifig around the environment.



Once the mesh was imported and post processed, it needed a skeleton, rigging and animating along with a third person walk/run controller.

As these are reasonably trivial there isn't much code detail to show off. The skeleton is a hierarchy of about a dozen physics objects. My physics evaluation runs in two passes. The first pass handles integration and the second resolves hierarchy - so its ideal for a simple skeleton with forward kinematics.

The skeleton is rigged in the minifig factory to a cheap one-bone-per-vertex system, which is enough for prototype although I'm itching to make it look nicer.

The animation is a procedural walk/run cycle, and I've stubbed out a keyframe animation player and anim blend tree that I'll fill in later to do some more fancy anims including idle loops, blending between gaits and partial body anims for actions.

The walk run controller is a modified version of the orbit camera from my Mesh Tool application with WASD movement pushed onto the skeleton Root motion. There is no footstep matching so there is some skating, especially on turns.  Again, this is good enough for prototype and it'll land on the backlog when it need to gets resolved.

The minifig is parameterised by colour and body element but without painted torsos or heads. I'm probably going to play with the root motion, gravity integrator and collision for a while, and then look at minifig customization more when I roll out a multiplayer server.

Until next time, stay plastic!

Wednesday, 24 July 2013

Minifig Factory


The new progress today was a minifig factory. It diverged from my common factory pattern of having a pre-populated database of creatable objects that are requested by ID. Instead, a MinifigParameters object contains a description of each element and which bone it attaches too.

The MinifigParameters object is passed to the factory, which returns a fully constructed and configured minifig including a render component that can be added to the scene.

For ease of use the MinifigFactory creates a Minifig skeleton that describes the physics hierarchy. It creates all of the mesh instances with a MeshRenderComponent and ties everything together based on the MinifigParameters passed in.

Lastly, and as a temporary measure, the MinifigFactory also constructs an example MinifigParameters object that I can use. I'll probably end up with a MinifigParametersDatabase that can retrieve parameters objects that describe specific Minifigs by unique ID, or wrap that process in the MinifigFactory so you can request minfigs by unique ID or by passing in a parameters object.

Solving the minifig construction task was a good self-contained process. The next step is probably adding the WalkRun controller with camera and then the animation controller after that.

Until next time, stay square!

Sunday, 21 July 2013

This kinda worked


Showing off the detail, this kinda came together. There are still a few imperfections in the geometry that I'm going to resolve manually at a later date but what I've got is suitable for now.


Its 1AM and the mesh is in a usable state for animation, which is a good place to finish the weekends work.

The next task is to add a Walk/Run controller to the Input and Camera stacks, and tie them to the minifig locomotion.  Once its moving in-game then its time to write an animation library. I think the first pass will be FK bones with a single bone-per-vertex, CPU skinned.
This will be my reference animator and then I'll reproduce it with GPU skinning and switch up if the video hardware is capable.

I'm considering rigging for two-bones-per-vertex skinning and pre-multipling the inverse T matrix during mesh cooking, but I think that's going too far for now. I'll only need one bone per vertex for a long time yet and will be able to get the animation fidelity I'm after.

With beauty shots like this, it becomes apparent how poor the specular highlights are on my reference shader, so a new plastic shader is in the immediate future too.


Submesh breakdown


Because I had a couple of minutes, I rewrote the LDR importer to divide the mesh into discrete submesh components and now post processs each component for normals and smoothing before recombining them.
Sections with a shared triangle edge are treated as the same submesh, and I just walk all of the triangles edges to build each one.

Here is a composition of the AirTanks(3838) and Hips(3815) meshes with each submesh colourised. There are a couple of tears in the mesh which I have yet to get to the bottom of but in general it proves the concept and demonstrates the process is probably sound.



To achieve this I created a new MeshToolApp. My Application base class looks like this
class Application
{
public: virtual int Execute()=0;

public: Application() {}
public: virtual ~Application() {}
};

So the main method looks something like this:

int main( int argc, char ** argv )
{
Application * MyApp = new MeshToolApplication();

int Result = 0;
if ( MyApp )
{
Result = MyApp->Execute();
}
return Result;
}

There is a little more to it in practice as I first parse the command line parameters to determine which application to execute, and there is some other init/cleanup, but this demonstrates the pattern very well.

The mesh tool app instantiates the same engine, renderer and input code as the main application but supplies an orbiting camera so I ca spin around the model to view it. It has simple import/load at the moment - once I'm happy enough with the post process I'll add a GUI to load, convert, view and save meshes. The last step will be creating a MeshConvertApplication that scans the content folder for LDR meshes and serializes out a converted mesh as an automated process.  It might render a screen capture of each mesh and save a bitmap for each one too.






C++ Test Framework


I had a couple of questions about my test framework, so I thought I'd come clean and show just how quickly you can get off the ground with a couple of macros in C++

With all of the code in Pioneer, my goal has been to do the minimum required to get the job done and my test framework is no exception. I rolled my own test framework as an exercise in understanding what a test framework does, is and should do. Needlessly reinventing the wheel is core to the development philosophy of pioneer and a great way to learn about systems.

I decided that I want to be able to tag tests at the end of the source file for the class they test, and that the syntax should be simple. I also wanted them to be easy to compile out so I knew macros were likely to be involved.

/////////////////////////////////
#include <unittest.h>
START_TEST( ExampleTest )
... test code ...
END_TEST


My minimum test for a class is a smoke test that instantiates an object and confirms that its non null. This is a sanity test for the constructor and checks for crashes, assertions, exceptions, errors etc.  I prefer to only use tested dependencies - test friendlys - and any other test on the object would require an instantiated object

/////////////////////////////////
#include <unittest.h>
START_TEST( World_SmokeTest )

{
WorldPtr world( new World() );
CheckNonNULL( world.get() );
}
CheckTrue( true );

END_TEST

This smoke test makes two checks, the first is that a world is instantiated without error and the second is that the object can be destroyed without error. I've used a scoped pointer, so this test just needs to report two successful checks and I'm happy. The default behaviour for my test log is to report the number of passed tests, the number of successful checks and a verbose list of all of the failures.

Within each test I can call on any of these Checks, which have so far been enough.
CheckNonNULL( a ) 
CheckNULL( a )
CheckEqual( a, b )
CheckNotEqual( a, b )
CheckTrue( a )
CheckFalse( a )

The START_TEST macro declares a class with the name of the test. It also registers it with a static instance of the test suite.  The test suite is the only global static object I use, and is compiled out in production code. Its the worst way I could configure the test runner except all of the other options.

With my START_TEST macro, the test case is registered and becomes part of the global test suite, which makes adding new tests super easy. There is no excuse for not adding a test after writing (most) public methods and its easy to write the test before the method too.

However, a few improvements could still be made. As the START_TEST macro declares a class with the test name, all test names have to be globally unique. This hasn't been a problem because I prefix the test name with the name of the class being tested but its a weakness in the system nonetheless.

I'd like to be able to declare tests per class. For example the test declaration might be:

START_TEST( World, SmokeTest )
... test code ...
END_TEST

So now I could report the classname of the system under test in the test report along with the test name, and potentially use it for test-coverage metrics as I could count the number of tested classes, tests per class and potentially add instrumentation for untested classes so I had a good idea of coverage.
I have an idea that a test-energy graph could be overlaid on a class graph so I could visualise test coverage as a heat map.

Secondly I might want a test suite to contain subsets of classes. Input/GUI tests, gameplay tests, network code tests, etc... This could be grouped with an ADD_TEST_TO_SUITE macro or with an extra parameter in START_TEST for the suite name.  I don't have a reason to run a subset of tests though - I really like having them all run every time and they are so fast that there is no cost to doing this. As soon as I fall into the practice of running a subset I might suffer from slow-to-execute test, or from breaking a test that I'm not running.
I've not got a good reason to add test suites, yet, but I've got a niggling feeling its a good idea.


Tuesday, 16 July 2013

Mesh Smooooothing


Mesh Smoothing in general terms is pretty straightforward, but automating is a little harder.

I'm trying to automate my unify rather than manually specifying for each mesh. The compromise I've come up with is to record the bounds of the mesh, and compare to the bounds of the unified normal tips. Whichever normal orientation has the larger bounds for its tips must be the mesh that is the right way around.

My Mathematical solution was to determine if the normals are divergent or convergent, which kinda works for platonic solids but probably not for any of my meshes. I'd love to investigate this further as it feels like fun, but remains the wrong solution to the problem so I'll be leaving that stone unturned for a long time.

Checking the bounds should work for non enclosed meshes, which means I can split my airtank into several submeshes and resolve them individually with reasonable confidence they will all be the same way around when I recombine them.

I've also written some code I really don't like for this.  My CalculateFaceNormals(...) method takes one parameter - that it operates on via side effects and has no return value.  Likewise for my UnifyNormals method. They both take a collection of triangles. Now that its in blog form, its really apparent that they should be methods of the MeshResource class.

In short I think I really prefer
myMesh->CalculateFaceNormals();
to
CalculateFaceNormals( triangleCollection );

So in the spirit of being a Good Boy Scout I think I'll move those over before I leave the mesh code alone.  I've found it reasonable easy to read, even though I've not touched mesh code forever, and the new importer dropped straight in with no fuss.



As a consumer of the Mesh code, the class you deal with is a MeshFactory.  I use a MeshFactory to make MeshInstances for me, and put them in a MeshRenderComponent that I can attach to the scene graph.  

The MeshFactory gets MeshResources from a MeshDatabase.

All of the new import and postprocessing works behind the scenes of even the MeshDatabase. As long as the importer derives from MeshImporter which returns a MeshResource then I can keep developing new loaders and mesh processing and remain seamless to the rest of the application.

By moving my CalculateNormals() UnifyNormals() and AutoSmoothNormals() code to the MeshResource, I can apply it to MeshResources loaded from any file or even procedurally generated meshes. I'm temped to make them mesh processing components of the MeshResource because they don't apply to *every* mesh but for now I think adding them directly to the MeshResource is fine.

I'd *kind* of like to be able to apply them to MeshInstances so I could include them in a mesh view tool, and toggle each on and off but really that''s not relevant to the task so it can wait.






Sunday, 14 July 2013

Gasping for air


So my LDR mesh importer is far from complete, but its a good start. If I want to build meshes at runtime suitable for GPU skinning there is still more work to do. I've broken the back of the mesh pipeline but do have a couple of bugs to ponder over before pushing too far ahead.

The LDR format isn't really designed with run-time performance and games in mind. They models are generally high detail - in many cases higher detail than I need but not without flaws in the geometry. Model 3838, the classic space Air Tank, is a good example of a well detailed model that diverges from games requirements - Its hollow. Being hollow is great for injection molding but not so great for realtime 3D. I could cap the ends and save the internal geometry. Actually, a lot of LDR models are brick-accurate in ways like this that are irrelevant to me.
Secondly, the AirTank is clearly several submeshes, and I'd rather have one mesh per element.

The LDR format doesn't specify a winding order - worse it specifies that winding order is irrelevant. However, I'm using counter-clockwise triangles so have had to write a Unify Normals mesh post-processor which isn't too much work.

Couple this with the knowledge that the meshes are not contiguous, which means you can't walk the geometry and unify normals. This is something of a shame, and demonstrated here.
The AirTank element is recognizably made from three or four non-contiguous sub-meshes.
The crossbar at the top, the mounting harness and the two cylinder tanks.




The closeup demonstrates that the mounting harness contains a mixture of CW and CCW triangles by visualizing the vertex normals as red lines.

The lovely attention to detail is otherwise well appreciated.  Its just that in this instance it gets in the way of progress.

My solution is to reduce the model into its submesh components and unify the surface normals per submesh and then concatenate into the original mesh before saving out as a serialized bytestream.
My quick-fix, since silicon is free and infinite, is to disable back face culling and ignore the winding order. The increase in rendering is insignificant in the small scenes that I'm using.

By not occluding back faces, I can move straight on to building a skeleton, rig and skin out of my minifig mesh parts.





Spaced Out

After taking a bunch of time off I thought I'd write some mesh tools.
This takes a vertex list, generates face normals and then uses the face normals to generate vertex normals.

In short, its a mesh-auto-smoothinator which will be a keystone in my content pipeline. The example mesh shows a side-by-side of auto-normals and then a smoothinated mesh with smooth areas and hard edges maintained.
(Also, this is a super-secret clue on what the next feature is.)



The LDR mesh importer loads LDR primitive objects. It throws away the line type data although I'm seriously considering processing this at a later date, since I'd love to have good wireframes.
The Mesh Import was reasonably quick at one 200 line class. Although there is an obvious extraction refactor to split the code up I found it was manageable enough at its size so have let it be.

The Mesh Post Processing was aroud 500 lines of code, and rammed into a single class with about four or five responsibilities.

  • Quantize the mesh so that similar vertices are identical
  • Build a tringle list from the vertex data
  • Unify normals by rewinding data
  • Calculate face normals
  • Autosmooth to generate vertex normals

The system relies on a dozen or so unit tests, although coverage isn't exhaustive.



Monday, 22 October 2012

Under Construction


After taking a couple of months out to play Pioneer, to work out what to do next - then a couple of months to figure out how to do it... I've finally moved back into development. As usual Life Got In The Way, which it has a habit of doing and overall I've taken close to a years break between sprints.

I've taken a little time out to rework the renderer a bit, I've gone for soft shadows which really helps ground the scene and make it look a lot more solid. The look and feel here is key, and while I'm a long way off I think shadows were a nice distraction to have worked on. There are a few other graphics and rendering tasks on the list, but they might be backshelved for a while if I move into serious development.


Viewing the work of LEGO artists and communities on-line has really helped define the first goal of Pioneer Development - Sharing models and scenes. While there are a number of pre-rendered LEGO images that artists have made, I've not seen much real-time LEGO building, and I think the Pioneer environment would be great to help people share their MOCs if they don't have access to CG rendering or CAD.

Pioneer should be about sharing images, models, scenes or worlds. Its about Playing Well, and Playing Together. I want to be able to share what I've built and see what other people are building. This is about social building, and brickmanship.

I also want to be able to view historical sets, particularly the out of production iconic sets like Classic Space that helped build the LEGO brand over all these years. This is a celebration of everything they have done, and my homage to them. I'm not sure how this is going to play out, it might be I make a gallery of images, or of models to view. I'm avoiding all modern sets, all recent copyrights, brands and licencee material and anything that overlaps the LEGO company, their business model, their on-line presence and their console games. 

Lastly, I've got my eye on building a world that Minifigs can explore. A dynamic, changing world made of colourful bricks. This is a log term concept for the project, and goes above and beyond anything I've got planned.  But I'm aware that building a castle, town or lunar-base for minifigs to inhabit - or for you to walk around among them - would be a lot of fun. I pioneered networked multi-player during early development and think there is some strength to the idea of collaborative play.

So, that's where I am, and what I've been thinking about.  If you were part of the Pioneer Alpha program, thanks for playing. There will be a beta soon - I'm putting together an improved building UI based on feedback and incorporating a couple of other features that were requested. 

Keep it square, and think inside the box!

Thursday, 29 December 2011

New Code



A dozen classes later and I've injected a mock into my rendering thread so I can interrupt draw calls and simulate almost the entire process. This basically makes everything up to the draw call unit testable and turns my code into the most complicated of bagatelle machines.


Network packet arrives in one end, bounces from pillar to post, draw call comes out the other end!


This brings me a little close to Alpha, but more in a holiday-spirit-playing-with-code sense than the typical slaving over a hot keyboard.  As I don't get paid for developing Pioneer I've been putting it aside for my birthday and then Xmas and have only snatched a couple of half-days this month.


In general the classes are easier to work with, and places the last stepping stone before adding variable level of detail rendering modes and dynamic shadows.  Its also a little faster/smoother when playing and has fixed a really obscure visibility bug that would sometimes leave you with an invisible brick.


The large benefits have been the removal of a cyclic dependency which has meant I can straighten the code out into a directed acyclic graph. All elementary stuff but removing this particular spanner from the works has been kind of a personal quest. The new object graph (and a couple of mocks) has meant I can easily increase the test coverage, which is the next thing I'm going to fiddle with because I was a bit lazy on that front in the last couple of sprints. I'm probably going to see what I can do about cutting those mock objects out of the test harness too, since they add a potential maintenance cost.

Monday, 28 November 2011

Code Mines

This is another no update blogpost, but a real update is getting closer.  A previous code review left me pondering... What if I just did it right?
So I thought I'd practice what I preach and do all of those fancy things that smart programmers dao.

The Pioneer codebase has always been dominated by the Brick class which describes the size, shape, position and colour of a building brick, and the Chunk class which measures 16x16 studs, contains zero to many Bricks and is arranged spatially with other Chunks to form the World.  Almost everything was either in one of those classes, or operated on them.

So the code was largely a bit of a lump. The Brick and Chunk classes became tightly coupled, with the World becoming a resource locator for chunks. A simple shared pointer made it far too easy to pass ChunkPtrs around and hold on to them even though - theoretically - they were short lifespan objects.

While I stuck to reasonable guidelines and practices, it became easy to add lazy features and it wasn't until I wanted to add mesh LoD and runtime LoD switching and discovered that it was a bit tricky. The possible solutions
- expose more members as public, either through access specifiers or get accessors.
- bundle more responsibility onto the already bloated Chunk class
- refactor so that the object graph makes the new feature easy to add.

Both of the least-effort solutions felt pretty bad, but it looked like it should be fairly easy to extract a responsibility FROM the chunk and isolate the rendering in a new object.  Even if it was a RenderableChunk class, it could still steal all of the occlusion, rendering and become a container for that stuff where it should be easy to add that mesh LOD functionality too.

And so the project went through whatever the opposite of suffering is as I pruned back the almighty Chunk. It lost a lot of fat, it also became a Directed Acyclic Graph and I could strip out a now redundant cycle.

Compile times were a little slow so I retypedeffed my shared pointers to incomplete types and made all of their clients rely on the abstract interface instead of the implementation.  This reduced the amount of include files getting chained together and allowed me to hack away in small, fast iterations.

The new acyclic object graph made the test suite simpler and much easier to expand to be more comprehensive. I was never satisfied with my test coverage and having that easy to improve is a load off. Its almost as if the "better" code was also easier to unit test. Astounding!

Programming can be a bit like a new LEGO build. You know what its supposed to be when its finished but you haven't got any instructions so you add and remove bricks, and each iteration will get you incrementally closer to your goal. One brick removed, two bricks added.

There will need to be more time at the keyboard before anything appears, but the last of the big changes has happened. From here it looks like I'll just be putting bricks back together. Maybe the odd one or two will be shifter, but I've solved the problem I wanted to solve and a few more to boot.
















Monday, 15 August 2011

Code Quality


I generally believe that code should be easier to read than to write. There aren't many exceptions to this and hard-to-read code is often a signifier that a brief code review might be in order.

Tonight I discovered a class that doesn't do what it says on the tin, so didn't do what I expected it to do and had two responsibilities so boot. So its been split in two, and each half aptly named. In retrospect its a lot of typing and when you finally run the game its *exactly the same* but that's kind of the point of this kind of refactoring. Its made adding new stuff easier and what I've got is easier to read for future revisions.

The clean-up has exposed a juxtaposition of bad habits, itself a more interesting point than the code or class layout in question. The contents of the class was place holder and had been overlooked for quality because it was "only temporary". Another symptom of being left to rot was the suspicious 'todo' comment that had never been followed up.

The experience has highlighted a serious difference between a naive implementation and bad code. Knowing that I was writing an implementation that was going to be thrown away meant I'd turned a blind-eye to a poor choice of interface, and that's where the rot started.

The old lesson relearned... there is NO SUCH THING as throwaway code. As you write, you just don't know how many weeks, months, or years a temporary class is going to last. I could just have easily have looked at it, saw it was ugly and left it alone. Or compounded the problem by just hacking my new code in. But the clean-up has left me with more functionality, less code and more readable, intuitive classes with shallower inheritance.


Sunday, 14 August 2011

Sprint 17 Complete


Sprint 17 has landed.

It has the new pantones, a few new bricks and a couple of tweaks. The vertex and fragment shaders have been disabled for now but will be back in a future sprint soon. A lot of graphical tweaks are pencilled in for release 19, while I'm expecting to focus on core building and useability for 18.

Thursday, 11 August 2011

Vertex Shader. Yeaj!


And as if by magic, the answer game to me!
Just the act of making a tasty tasty coffee was enough to stimulate the little grey cells. I had a play with vertex and fragment shaders recently but I was only really having a play in the 'play for fun' rather than nerdcore critical-path programming.

One of the shaders I wanted to write was to make my blocks look a little more like physical LEGO bricks. The LEGO company make the plastic construction toy that has been my inspiration and physical building materials have different properties to intangible polygons.

Simulating the look of a real world item with computer graphics is always a fungineering task, but I hit upon the technique I'm going to use to get that extra va va voom out of my graphics pipeline using a vertex shader in the base render pass instead of during post-process or using a second render pass and additional VBO set.

More news as it breaks!

p.s. You can support the LEGO company by buying sets, bricks, toys or apparel from their online or storefront retail outlets. I highly recommend basically everything they sell.

Thursday, 28 July 2011

New Cols


I've tweaked the colours tonight. They are brighter, and more complementing. They just go together better really. There are other lighting and shading effects I want to play with, but getting the base colours right was fairly high on the list.

Wednesday, 27 July 2011

Sprint 16 Complete... 17 is underway


I can't really tell if 16 is complete or not. Its got an (NPE) crash, but that wasn't found until I said 'finished' so fixing the thing is technically the first part of Sprint 17. It feels horribly wrong to say 16 is complete now I know there is a bug though.

Either way, its heads-down on 16, which is checking/asserting some pointers but I don't have a repro so just can't be sure.