Jump to content

  • Log In with Google      Sign In   
  • Create Account

SIC Games' Journal

Engine Update - Rendering Bounding Volumes

Posted by , 23 August 2015 - - - - - - · 870 views
DX11, Bounding Volumes, AABB
I'll get Bounding Sphere bounding volume to render shortly. I just wanted to render a AABB. Awesome thing is it's now fit to the actual mesh. Sometimes when the mesh gets imported - it has to be scaled down a bit leaving the min max verticies for the AABB to be the same. I'll fix that after loading time - so it's best fit bounding box.

Also I added blinn-phong in the scene too.

Also forget the green background - it'll be put black again.
Attached Image

Engine Update - Frustum Culling, multiple subsets

Posted by , 13 August 2015 - - - - - - · 797 views
DX11, Frustum Culling and 1 more...
Today I got around to adding loading multiple sub meshes and frustum culling. I'll be looking more in depth of occlusion culling and other culling techniques as in Octree Culling.

Attached Image

As for the Pillar Ball model I just quickly made it in 3DS Max without caring about unwrapping UVS. That's why you get that awful stretch. I'll be working on having each texture has it's seperate sampler and each shader has it's own constant buffers.

As now it's every mesh has it's own constant buffers. Not every constant buffer is treated equally - bill board shouldn't have the static meshes constant buffer. Foliage shouldn't have the same constant buffer as billboard even know it's the billboard swaying inside the wind direction.

That's it for now.

Game Engine Update - Bloom Post Process

Posted by , 22 July 2015 - - - - - - · 1,330 views
Finally today I've added bloom - I know not every object has bloom in the real world. It bugs when when I'm playing a game and I see a shirt giving off bloom effect.

Originally I was rendering normal scene and bloom scene to different render targets. Then I was applied the blur to bloom texture using a UI Bitmap Element. I figured it out it wasn't working the way it should.

So, I had to make multiple render targets:

1) Normal Scene with lights rendered.
2) Bloom Scene with threshold of 0.3
3) Blurred horizontal of the bloom scene
4) Blurred verticle of the bloom scene from previous horizontal blur.
5) Output the bloomed and blurred to final render target.
6) Render 2D Quad and disable depth buffer outputting the final bloom effect with combination of normal scene and bloomed scene together.

Viola we get this:

Attached Image

I rendered the scene with it's original size. The bloom scene and the blurred horizontal and vertical were both rendered as 256.0f then upsized to the original size of rendering window.

I believe if I step it up from 256.0 to 512.0 then full rendering window size - there should be a very nice gradual looking bloom effect.

Next ambitious step is to work with light shafts and head back to SSAO like I was working on earlier.

Game Engine Update

Posted by , 18 June 2015 - - - - - - · 1,185 views
DirectX 11, Game Engine and 1 more...
I'm just going to make this quick entry in my journal. So far there's been a couple nice updates; the ability to play my own video format perfectly. The ability to create a spinning progress ring while a scene loads. On top of the scene loading - it is multithreaded to load the scene while displaying the progress ring. Once finished loading the scene then it renders the whole entire scene.

The videos you can check out are on my youtube channel. The User Interface Progress Ring uses D2D1 and Windows Imaging Compnent which was neatly plugged in today. I'm just taking my time while I do other things.

I'll probably get a neat menu system going on eventually - perhaps a nice loading background image while I the scene is loading. Perhaps a display of hints - not sure. We'll see what's up.

Until next time - have a good day!

Performance testing with bit operations, SSE2 and asm

Posted by , 01 May 2015 - - - - - - · 1,205 views

Today I figure I sit down and see how SSE2 is benefitial to a game. I don't come fromt a strong background knowledge of ASM code. However, I found it fascinating to say the least! I can understand the headaches that go into ASM but if you can get around knowing some ASM then you're good to go on SSE2 instructions.

As I already aknowledged from previous issues with DIrectX Math is the vectors have to be 16 bit aligned or there will be access violations exceptions thrown about. I recently had issues like this when I changed the camera class.

On my performance test I tested out a simple function that would return the minimal of two floating points.
inline float _b_min(float a, float b) {
          return (a < b ? a : b);

inline float _a_nin(float a, float b) {
      float result = 0.0f;
      __asm {
            mov eax,a
            mov ebx,b
            cmp eax,ebx
            mov [result], eax
return result;

the function _a_min was a bit faster than _b_min. _a_min gave around 900 microseconds.
_b_min function gave over 1 millisecond time elapsed from the high resolution timer.

The sse2 min function gave me around 0.003 milliseconds.
inline float *_sse2_min(float a, float b) {
    __m128 _a = _mm_set_ps1(a); //-- set _a to the floating point a;
    __m128 _b = _mm_set_ps1(b); //-- set _b to floating point b;
    __m128 c = _mm_min_ps(_a,_b); //-- return in C the minimal of _a,_b;
    float *result = (float*)_aligned_malloc(sizeof(float), sizeof(float)); 
    _mm_store_ps(result, c); //-- store the result float* result;
    return result;

my question is for whomever the reader is - why is SSE2 and bit operator maniupation a bit slower than ASM or does it not matter? Possible SSE2 is better with bigger data than just comparing minimal of floating points?

Started to Dive into the Compute Shader!

Posted by , 06 March 2015 - - - - - - · 1,468 views
DX11, Compute, Compute Shader and 1 more...
I admit personally that when I heard about Compute Shader that I thought it was an over complex odeal. It's actually fascinating because of the parallel possibilities. It's literally turbo charging your game's speed to create box blurs or any other post processing effect; even managing physics with particles.

I created a Unorder Access View then from that I was able to save the image you see below. It's simple example not over the top but gave me the basic idea on how a compute shader works. The texture I created for the UAV and SRV was 1024 and so for every 1 pixel to fill up the 1024 image; the gradiant ramp you see is the results of the XY threads.

Attached Image

I'm digging the whole compute shaders and I'll be exploring the unlimited possiblities with them. I understand the compute shaders won't solve everything and it helps hide some stalling. I'm actually glad I looked more in depth into Compute Shaders.

This is just me overly exciting ranting Posted Image

Edit: A new attached photo shows what's being rendered to a render target to compute shader as is not post process effect via compute shader.

Attached Image

There's more to learn from this great experience I must admit! I look forward to it!

Another great way to reduce my insantiy with interfaces...

Posted by , 17 July 2014 - - - - - - · 762 views
Abstract Classes and 5 more...
Upon revising the engine's SDK - I finally understood how powerful creating interfaces can truely be! Say inside the level editor the grid outline outputs color - the skybox outputs texture data - meshes output a material shader and billboards output with a geometry shader.

This is where the beauty comes in play.
//-- ShaderSystem.h

//-- Base
struct Shader {

virtual bool CompileShader(ID3D11Device *device, const wchar_t* filename) = 0; 

ID3D11VertexShader *vertexShader;
ID3D11PixelShader *pixelShader;
ID3D11GeometryShader *geometryShader;
ID3D11ComputeShader *computeShader;
ID3D11DomainShader *domainShader:
ID3D11HullShader *hullShader;
ID3D11InputLayout *inputLayout;


//-- ColorShader.h
#include "ShaderSystem.h"

struct ColorShader : public Shader {

bool CompileShader(ID3D11Device *device, const wchar_t *filename) {
//-- Compile Shader.
return true;

and so on with other shaders that I have to work on that may have different elements in the inputlayout e.g. instance data and alike.

I'm still going through a lot of code to see how I can make a lot more readible and less confusing. My original code for the engine was very very confusing and there was a lot of stuff I had to learn before I got to where I am today. This forum actually helped me through a lot of the messy hiccups - amongst reading up new materials.

I'm getting there than I had the year I signed up on here. I don't remember when I singed up here but it was a couple years ago I believe. So I can apply this knowledge to my in-house game engine even more.

Take a Break - Step Back - Rethink - Reoganize

Posted by , 21 October 2012 - - - - - - · 735 views

Sometimes taking a break from this forum is healthy. Sometimes taking a break from game programming is healthy as well. Every intrepretes another person's action by previous experiences from other people. A belief system that is learned through powerful charged emotional experiences with people - usually sets these triggers off. For me, intelligence is more of a trigger. I'm not smart like Bill Gates nor John Carmack. Bill Gates is 180 and I wish I can be smart like him. Another derailment is my motivation in game development was to show those previous people in my past that I can do it - I am smart.

Upon taking a break from game development and this forum - I noticed subtle changes. 1) Does it matter if I am better than those people in the past that torn me down? Who knows. A long fight about the past is like climbing a long steep moutain which will eventually give way. Hence, this is where the attitude and negative impulses to argue come into play because the mind intrepretions. A man goes on several dates and ends up rejected - automatically the belief system takes part and says, "Next time - I'll be rejected" or whatever false belief. Back to the sizeof and SIZE_T argument that I once held firmly. I was dead wrong because I re-read the post and realized the SIZE_T isn't the same of sizeof() function. Ever notice when calling someone on their game - they get defensive? This happened to me. When someone wishes they were something whereas they currently don't possess - they defenses go up as if they are feel attacked. If a egoistical male brags a lot that he is hot stuff - someone calls him out of his game...What happenes? There's a huge spiral usually denial which leads to aggrivation and temperment.

Anyways; besides the rambling on about the physlogical aspect about how I or anyone could take the smallest critism and turn it into a monsterous snowball. I suppose there was a stresser or what not that hit my nerve prior to the argument on the forum. There's one thing for sure is there's less to prove to others but more to prove to myself. I often question myself why am I on this forum whereas when I post - I end up at times talking to myself or someone will comment a bit complexed than I can chew on. If you tell me how to make a spud cannon and how it works this is easier to digest. So a car engine just works because it works - this will literally fly me across the room and total confusment. A car engine by compressed air mixed with gasoline - whilst compressed the spark plug creates a electric arc to ignte the piston downward...Oh, okay I get it!

Final notes; do I still want to program a game? Sure why not. Am I going to rush myself due to feeling pressure of losing my wife. no; absolutely not. I realize I'm by myself on this and yes; there's gonna be lag time til whatever project is finished. Bottom line; Firmaxis games didn't come out with XCOM Enemy Unknown just in 5 months. It took years to plan; organize and come up with improved concepts the original XCOM game didn't or did have that can be improved upon. So, yeah there's time to be part of the equation. Patience is gradually needed for long goals. Impatience is wanting only the short term goal.

ALright; well have a great week. I'll be back whenever I decide.

Fix Fix Fix-A-Roo

Posted by , 07 October 2012 - - - - - - · 1,090 views
DX11, Editor
Spent about the week or two weeks re-structurizing the framework. So, far so good! Upon creating a improved flow instead of using tons of pointers; I had to fix little minor issues: when window was minimized and restored it pooped out a external exception. This is fixed. When I maximized the window or resized the window - the 3D Model looked like stretch-arm strong and all funky. Fixed this too.

Future add-ons:
  • Tesselation factor determined by length of camera.
  • Mip-Mapping level correction determined by length of camera.
  • Sub-sets in the custom mesh file.
  • Shader Editor or Shader Graph Editor. Haven't decided yet.
Possibly more.

SICEditor 1.0.0 - UI Changes

Posted by , 01 October 2012 - - - - - - · 965 views
DX11, Realtime, Level, Editor and 7 more...
There's been some improvements since last video of the Dynamic Shader Reloader. The UI is startting to look tidy and smoother. Currently, working out the kinks of the camera. Next video will show cool features that I'll like to implemend. Picking will be possibly in next video, which I've been working on. I've been going back and forth with the idea of having a terrain editor or have the game mostly indoor. I beleive one scene will be outdoor then mostly indoor. So, it's a toss up.

Here's the video showing latest changes. Hope all you like! Throw any ideas or feed back and I'll appreciate it! :)