Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Sep 2011
Online Last Active Today, 04:17 AM

Posts I've Made

In Topic: Transitioning from game development to business development with C#

28 August 2016 - 12:37 AM

One thing I would like to add: Learn how to write unit tests and how to write software that it is properly unit testable.

This is valuable for two reasons: Firstly, "Test Driven Design" is one of those buzzwords that look good on a CV.

But more importantly, thinking about the testability of the code you write almost automatically nudges you in the direction of the SOLID principles and can be a good place to start thinking about software architecture.

From my experience in the "big business" world, having unit tests is the first step towards avoiding spaghetti code.

In Topic: DirectX11 and using more than 1 shader

27 August 2016 - 03:50 PM

Are you using some framework that we're not aware of? I suspect our definitions of the term "mesh" differ somewhat.


Each frame does basically the same thing:

- clear the entire screen

- for each "thing" you want to draw

   - set up the pipeline (probably at least a vertex buffer, a vertex shader and a pixel shader)

   - call draw

- repeat


If you want to use a different pixel shader for a specific object, you just use that pixel shader when setting up the pipeline for that object.

To start with, I suggest setting up the pipeline from scratch for each object. Optimizing for performance comes later.

In Topic: DirectX11 and using more than 1 shader

27 August 2016 - 02:23 PM

Each draw call uses the shaders (and other pipeline state) that were set on the device context previously.


Set Vertex Shader V1

Set Pixel Shader P1

Draw Mesh 1 (uses V1 and P1)


Set Pixel Shader P2

Draw Mesh 2 (uses V1 and P2)

In Topic: Best way to handle multiple lights

05 May 2016 - 01:57 PM

2 -Upload an array of lights into a single shader, and do a single draw of the mesh looping over the lights each frame

A modern variation on this would be tiled forward rendering or "Forward+", where you iterate over a list of lights per screen tile instead of per mesh.

In Topic: Is it C# Territory?

05 May 2016 - 01:39 PM

- Save time by going with C#

- Use saved time for pushing compute-heavy algorithms to GPU instead


This is exactly what is happening at my job currently (MRI scanner). Most of the user-facing code is moving from C++ to C#. More and more of the high-performance code is moving from C++ to CUDA and the likes.