• entries
    31
  • comments
    59
  • views
    35588

About this blog

Random Floating thoughts of Game Development

Entries in this blog

Paul C Skertich
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.
ScreenCaptured_nossao26254056.jpg
Paul C Skertich
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.

ScreenCaptured_nossao57647756.jpg

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.
Paul C Skertich
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:

ScreenCaptured_nossao00000297.jpg

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.
Paul C Skertich
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!
Paul C Skertich
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?
Paul C Skertich
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.

conputeOutput.jpg

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 biggrin.png

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.

conputeOutput.jpg

There's more to learn from this great experience I must admit! I look forward to it!
Paul C Skertich
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//-- Basestruct 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.
Paul C Skertich
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.
Paul C Skertich
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:

  1. Tesselation factor determined by length of camera.
  2. Mip-Mapping level correction determined by length of camera.
  3. Sub-sets in the custom mesh file.
  4. Shader Editor or Shader Graph Editor. Haven't decided yet.

Possibly more.
Paul C Skertich
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! :)

Paul C Skertich
I think I want the world FOC (Frustrated Over Coding) to be used now! "I'm SO FOC, I can't even see straight!"

Anyways, moving on! Not only me but everyone else have to get frustrated over coding - right? What do you do? Ever get that sensation in your stomach of heaviness when looking at your code?

I found that when I start feeling like bashing my keyboard across the roam, or get snippy...I play a video game. I take my mind off coding for a bit then come back - resolving the issue I was having. Haven't you noticed that when stuck in a rut in code, when you take a break then comeback; you have clarity?

What are some of your experiences you've noticed when you took a small break from coding then coming back? Have you came closer to a clearier solution? Do you write down what you want to the program to behave like?

This blog is just for discussion.
Paul C Skertich
Today, I feel that finally - I'm going in the right direction as I intentionally wanted to! I finally declared that I wanted my game level editor to be Real Time - You See What You Get. There's a lot to be done - yes, I know! However, this video simply demonstrates the Dynamic Shader Reloader.

I think perhaps, this is preperations for the Material Editor - we'll see where this takes me. I didn't feel like talking in this video, so I played a music I maded from Fruity Loops. :P

Paul C Skertich
First, before I write this - I would like to thank everyone that has shared their greatest support! Now, on to the good stuff!

I am reading deeply in multiple ebooks (E.G. Professional C++, C++ Game Programming for Beginnings By Example). If you're in need of a great book - I would have to recommend the Profesional C++ book. A lot of great advice and optimization tips. Okay, moving forward!

I updated the Model Renderer in the Editor by just putting a draw function inside the structure data element. As well inside, I initialized the structure and zero the memory for room. So, in the managed call it iterates through every mesh in the vector and calls the draw function. To my suprise it really did draw faster without a flitch. I have to ensure the everything there's no memory leaks; which I'm doing now at this moment.

I wanted to blog this because it was quite fascination and again like every idea couldn't hurt unless I try, right?

Well, everyone have a great day and thanks again for your strong support! Peace!
Paul C Skertich
Gotta admit, it's literally crazy to think I can do a indie company by myself. I've been rude to most people cause the real enemy is myself. You know that whole dream of being some body - someone that people will look up too, someone will remember when they pass on and say, "I remember that guy - he was one hell of a smart guy!"

It's not a people issue that I have - It's myself. I've fought hard so long to prove my wife's family I'm not a failure or disappointment as they said. Yeah, my wife told me that her parents and her brother would bash me down in the dirt because I'm either too lazy or things just too hard. I created a cool Physic Game and my friend Evan liked it alot - so I thought to myself, "Okay - I'll step it up a bit make a more interesting game." I don't mean to blab on about my woes - but... I realize there's more than just one person in a team and it doesn't include only just I.

Sorry, I've been rude and arrogent. Peace.
Paul C Skertich
I can successfully create a PAK file of my own format. At first, tested it with ASCII files to make sure it was doing what I wanted. Late this evening, I was able to put the required data into vectors and then for the binary data I was just able to grab the total size of the file place them in a short * buffer - then write it in the pack file.

I have the creation part down now, I have to move forward with the loading content part. However, thanks go out to Hodgman for his advice!
Paul C Skertich
I had to do more reason in DirectX Math and more programming exercising. I've looked deeper at the core of UDK and Amnesia's level editor. Whilst I was vacationing from this forum - I've looked into a creating a PACK File. Hopefully by in two weeks the next video upload will be released for those that are interested. Everyone have a great weekend! Peace!
Paul C Skertich
Today, I was playing around a bit. I created a Dynamic DLL file then tested it in Native Win32 Application. It was just a simple MessageBox pop up. I couldn't use the Dynamic DLL file in Managed C#, so I created a Managed Assembly using the Dynamic DLL file I created. Once this was done then I was able to transition to C# to use the Managed DLL file.

What have I learned besides Double Wrapping is this:

Different Pointers but same in reference in Dynamic DLL inside a CLR C++.

I can use both in Dynamic and CLR C++

Silly *sillyBoy = new Silly();
sillyBoy->SillySay("Sily Rabbit Tricks Are For Kids!");



However in C# I noticed:



SillyApp SillyBoyApp;
SillyBoyApp = new SillyBoyApp();
SillyBoyApp.SillyRabbit("Tricks Are For Kids!");



On additional notes, I noticed the need to convert a LPCWSTR to System.String from Native to CLR C++. For instance I had to pin_invoke the Dynamic Libray Say function:


void Say(String ^ What) {
pin_ptr msg = PtrToStringChars(What);

...
}



Where as from Dynamic DLL to Native Win32 C++ it's the same LPCWSTR because Managed .NET uses String.

Final conclusion:

The game's engine can use Dynamic DLL file but it would be a little bit over productive on my part to constantly convert to Native to CLR to C#. On the Editor's side - I can create a CLR C++ then bring it over to C#. This is how I've been doing it. However, as I discussed in my other threads - the transitional phase should be a bit more easier.

As some would say to work on the Game Engine first, I find that working with the Editor side first, allows me to at least to memorize and experience a lot more! It also keens my ability to be more diversed in language programming. Additionally, I've noticed I've been able to blaze through the coding process of CLR because now I'm Modulating all the Game Engine's Editor's functions. I think through repeatation - I learn more effectively.

Well, good night and everyone have a great night!
Paul C Skertich
I took a step back today...Poundered about how I can improve as a programmer and executing professionalism. I dismanteled the game engine piece by piece.

A new FILEIO Managed Assembly was put in place to handle the many Loading Meshes Etc... I learned how to use Interfaces to hold my important structures for reading Model data. I implemented Try Catch exception while parsing the Model's data. I brought the newly engine's FILEIO in C# to see if it will flag if the data is read or not. Good news is it has read completely.

The mesh reader is the same reader as before - has implemened interface for storing mesh data.

There will be more updates soon as possible. I am going back to do more reading on DirectX 11 and more reading about C++ CLI.

Have a great night everyone!

-Paul
Paul C Skertich
Today, I toyed with the camera collision detection system. I just want to see if I can detect if the position vector met up with the mesh's triangles and just stop there. What happened? Total nightmare! One occasion, the camera hit the wall then got slung back in the other direciton. Kind of reminded me the Swing Set of Doom in GTA 5. Another instance is when I kept on pushing W on the keyboard, I was eventually able to go through the mesh. Not good. Another instance was it stopped alright - but I was locked inside the mesh. Not good either.

So back to the drawing board. This should be fun for tomorrow.
Paul C Skertich
I'm sure everyone has stayed up wee hours of the night; while their gears inside their heads crank. Last night, was one of those nights - practically I thought I was going cross eye from looking at the screen too much. That would completely funny, right?

Onward with the good news without any wait. So, two days ago I loaded the custom mesh with ASCII. Cool yes indeed...I pondered and decided Binary was going to be the new format. Inside the converting program in C# which uses a managed assembly made in C++. I was able to convert a OBJ file into the game engine's own mesh format in binary. It took a couple of tries because I wasn't use to loading binary files. I'm getting the hang of it, I admit. Those & and * signs confused me. Finally, today evening the level editor was able to successfully load the binary file.

You know that grin that stretches from one cheek to the other, right? That overwhelming accomplishment and pride. I get that very often when I accomplsih something so very small yet big to me.

Wait a minute, there seems to be a hang up when loading a 22 MB file now...Okay, so; I threw it on another thread while it does it imports in the level editor. Cool, still a bit of a problem - it takes longer than the ascii file to load. You know the 40 mb ASCII mesh file of the Pillar I made in Zbrush? Sure, it loads the data correctly, however as of now it likes to load the small stuff.

So, I'm now looking into handling ways of loading a larger file.

I'll report soon as possible.
Paul C Skertich
C# is a much easier and user friendly experience anyone can have! Now, the editor's taking shape and looking fantastic. A small problem which will be resolved shortly is that when I insert another mesh file it replaces the other one already in the viewport editor.

However, as of now, I can add default lighting; still have functionality as I did in the C++ .NET version. There was a bit of a issue with the shader but I overcame it by marshalling it. I don't think it's ready for it's next WIP progress video yet. Maybe a couple weeks from now or a month. Just haven't decided. Once there's a rbeak through then yes the WIP video will be up. I'm am satisified but not merely enough.

Hope everyone's having a great weekend. Now, back on netflix watching some tv shows. Good night everyone!
Paul C Skertich
I think this would be awesome as all heck! I want to be able to generate a terrain flat - then like in Zbrush scuplt the terrain and texel paint the terrain. How cool would that be? You got a bull dozer to push back a section, just various of tools to literally create a awesome terrain scenerio! A water pot to grow vegatation!

I know there's procedural terraining and additionally procuderal buildings - I think that would be epically awesome! Plus, more fun for the arist, you know?

Voxels are awesome and I see the great advantage of them, on top of that megatexturing.

There's a lot of research to do and hell, maybe in the next update in a few months there will be something awesome out of the research I've conducted!

Signing out and sticking my head back in the Mad Labatory.
Paul C Skertich
I was curious and noticed that for one - the mesh loads quicker in my custom file. Which is pretty good! I noticed there's a relative difference in file size as well. The 3D Heart model in obj file format is about 111 kb. Same 3D Heart in FBX Binary is 106 kb. The same heart in my custom mesh file is about 93 kb. Which, The 3D Heart contains about in total of normals, texture uv's, vertices and faces about 2,000 range.

Additionally, it's literally Indices free which just alot of easier to load. How is it indice free? It's already computed when it converts into the mesh file.

I've been looking into compression techniques and binary. However, it would literally have a higher compressed rate thought! So, I'll continue to keep everyone updated but this is one awesome adventure I'm on! :)
Paul C Skertich
In my previous blog, I took a screen shot of my first custom file import. After looking at the mesh loader - I tinked around a bit. The original converter program was in Command prompt and there was a dying need to make things a bit easier. So, I converted the command prompt application into a .NET Windows Form.

A cube is pretty interesting but a bit more complexed box shape would be better, right? So in 3D Studio Max 2013 - I created a basic Cross. Ran it through my converter application and loaded it within the game editor. The light position is somewhere in the Z axis and more on the left of the X axis.

CustomModelImport-Cross.PNG

When I was trying to take a snap shot of this picture - the editor's camera would reset itself. Four times it took to try to use Windows Sniplet! I actually thought it was comical as if it was meant to not be taken a picture of! lol!

This is one step forward and more step forwards will proceed! :)