Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Oct 2004
Offline Last Active May 27 2016 12:22 PM

#5293668 Do you usually prefix your classes with the letter 'C' or something e...

Posted by cozzie on 26 May 2016 - 02:42 PM

I personally believe it's a combination of personal favor and/or agreements/standards within the team or company you work with.

Personality using C prefix for classes and mXxx for member vars help me in distincting them from each other. I also use pXxxx prefix for all function parameters, which I understand can be interpreted wrong (p could be pointer). I only do this because it helps me in efficiency, and I'm not bound to team or organization standards/rules.

#5293231 I doubt I understand RAII just yet

Posted by cozzie on 24 May 2016 - 11:11 AM

I agree, thanks.

#5292997 I doubt I understand RAII just yet

Posted by cozzie on 23 May 2016 - 01:24 AM

Like always, I wouldn't implement it for the idea. If you have good resource management and no issues, it's good to know it's possible but not necessary to implement.

#5291510 HLSL keywords 'out' works differently than 'return'?

Posted by cozzie on 14 May 2016 - 03:22 AM

I believe in your 1st approach you create a local object for the output structure, which you return in the end. In the 2nd approach you directly use the return value/object of the function.

#5278671 How to compile shaders in DX11

Posted by cozzie on 29 February 2016 - 05:03 AM

Note that it's perfectly possible to use effects 11 in your case. You can compile and generate the needed debug and release LIB in your own VS environment.

It all depends on your learning curve. I choose to use effects 11 because I need(ed) to learn so much other things from the Luna d3d11 book (I'll get rond of effects11 later on)

#5277943 Beginner with a dream.

Posted by cozzie on 24 February 2016 - 01:45 PM

3D models instead of sprites is fine, but remember to take it step by step. You can't eat an elephant at once, only 1 slice at a time.

Or as my boss once said, having a drivers license doesn't mean you can jump in a F1 Car and hit the tracks.

#5277758 Beginner with a dream.

Posted by cozzie on 23 February 2016 - 12:07 PM

You could pick up a copy of Beginning Game programming, a book by Jonathan S Harbor. It assumes you know the basics of c++ and will teach you to create a 2d game step by step (using directx in this case).

#5277324 Game Engine Architecture: what's after that?

Posted by cozzie on 21 February 2016 - 02:19 PM

My share; building both an engine and a game in a few months can be challenging (depending on how many other things you have to do in those months).

Try to make things small, define the features you want your engine to be able to do, with your game in mind.

#5277131 Should I always use float4 ?

Posted by cozzie on 20 February 2016 - 04:51 AM

There's no 1 true answer.
In general using float4's does the trick because multiplying with 4x4 matrices is most efficient.

I always balance between that and what I need to achieve what I want. For material properties I use float3's (conventional shading), maybe when I start with PBR that will be float4's also.

The 4th component is also useful to distinguish points and vectors (for correct multiplication etc).

#5275614 what are you using as "best in slot" libs for direct3d9/11?

Posted by cozzie on 14 February 2016 - 05:43 AM

For audio I prefer FMOD. Directx toolkit as mentioned above.
If you go for d3d9 I advise to use DirectXMath with assimp over D3DX, which makes moving to d3d11 later on, easier.

Or go for d3d11 right away, if that's an option for your goal/ audience.

Also VLD is a good library for managing memory (leaks).

#5275398 I want to learn all about game development on Unreal Engine 4 ?

Posted by cozzie on 12 February 2016 - 03:31 AM

Start small like the others said. In my opinion a hardcover book works best, do all exercises.

After that, make small applications and learn step by step.

When you believe you're reading to use an API or engine like UE4, you know your next step.

#5275017 Limiting light calculations

Posted by cozzie on 09 February 2016 - 11:52 AM

You can also do cheap squared length tests to check your (sub)objects with your light sources. Then store the ones that affect the object and only process these when rendering that object. Of course you can play with margins there also (bit lower or higher then the distance between them).

#5274745 Best way of finding resource leaks

Posted by cozzie on 07 February 2016 - 07:06 AM

I use a combination of d3d debug mode (enable in Control panel and use the libs ending with d) and VLD (visual leak detector).
Works good for me

#5273513 Classes and header files mess

Posted by cozzie on 31 January 2016 - 01:29 PM


You're question is too big (for me) to cover with just 1 right answer.

So here's my share:


- when you have headers that you want to include in several places, 'ifdef' them

(so they're just compiled once)

#ifndef CD3DCAM_H
#define CD3DCAM_H

(top of your headers)


- in general a class should have 1 purpose only (like mentioned above)

- when you want to make a 'game engine', think of modules, for example:

-- audio

-- IO

-- rendering

-- scenes/ levels

-- objects

-- meshes ( --- submeshes etc.)


You could use a namespace for each 'module'

#5273360 Order of transformation confuse

Posted by cozzie on 30 January 2016 - 10:10 AM

You could draw out both options on paper, where you do the different orders of actions.

This helps in illustrating whap happens (SRT, TSR etc.).


Here's a snippet of my 'old' engine code:

void CD3dmeshInst::CreateWorldMatrix()
	D3DXMatrixTranslation(&mMatTranslate, mWorldPos.x, mWorldPos.y, mWorldPos.z);
	D3DXMatrixRotationX(&mMatRotateX, D3DXToRadian(mRot.x));
	D3DXMatrixRotationY(&mMatRotateY, D3DXToRadian(mRot.y));
	D3DXMatrixRotationZ(&mMatRotateZ, D3DXToRadian(mRot.z));
	D3DXMatrixScaling(&mMatScale, mScale, mScale, mScale);

	mMatWorld = (D3DXMATRIXA16)(mMatScale*mMatRotateX*mMatRotateY*mMatRotateZ*mMatTranslate);

	D3DXMatrixInverse(&mMatWorldInv, NULL, &mMatWorld);
	D3DXMatrixTranspose(&mMatWorldInvTransp, &mMatWorldInv);

I believe it shouldn't matter if you're using OpenGL or Direct3D (not 100% sure though, if not, someone will correct me :))