Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!

Zaoshi Kaba

Member Since 04 Nov 2012
Offline Last Active Yesterday, 10:56 PM

#5117634 conditional statement + automatic clean-up in preprocessor command

Posted by Zaoshi Kaba on 17 December 2013 - 01:00 PM

You can do that with for() loop that does only single cycle:

#define IF_CONDITION_REALIZED_THEN for(DummyObject dummy(initializationType); conditionRealized; conditionRealized = false)

though it'll modify conditionRealized variable.

#5116862 Setting up VS2012 with Directx11 (multiple projects)

Posted by Zaoshi Kaba on 14 December 2013 - 08:41 AM

You should do steps #1, #2, #3 only for projects that use DirectX. "d3dx11.h" error happens when include paths aren't correct, "CreateDXGIFactory" error happens because you didn't link all required libraries; MSDN says you need "DXGI.lib".

#5115318 Completely overwhelmed - should I just give up?

Posted by Zaoshi Kaba on 08 December 2013 - 04:01 AM

Now I'm reading an 800 pages book that teaches math 3D thoroughly until I'm grabbing my hair and tearing it out lolol...


Books tend to teach extremely generalized theory, proofs, then provide less-than-minimal examples and don't explain how/why/when it is used. My belief is they're useless.

Have you tried playing with code or reading documentation? It's easy to figure what Translation/Rotation/Scaling matrices do; how they do it doesn't matter at all. View/Projection matrices are a bit harder to figure, but you have documentation, forums, Google. As long as you won't care how it works, but rather what it does you'll soon learn to use it.

#5114024 Its all about DirectX and OpenGL?

Posted by Zaoshi Kaba on 03 December 2013 - 07:51 AM

Playstation 3 provides SDK which you have to use to make games for it. Chances are it's not DirectX nor OpenGL (I don't have it so don't know), probably same situation with PS4, PSVita and other consoles. They use more or less same GPU architecture so it'll have same theory: vertex buffers, index buffers, shaders, etc.

#5108278 Reference/Value types in C#

Posted by Zaoshi Kaba on 10 November 2013 - 08:47 AM

Judging by your previous posts you seem to have experience with C++. You can think of objects as pointers to objects. When you remove one from List<> you simply remove pointer, but do not delete object itself (memory leak), but in C# garbage collector prevents those leaks. Therefore removing from a List<> will remove only reference.

#5108277 Smooth normals

Posted by Zaoshi Kaba on 10 November 2013 - 08:42 AM

My guess is that exporter didn't smooth them. There might be an option during export or in editor to create smooth normals.

#5107638 Namespace problem with boost and maxsdk

Posted by Zaoshi Kaba on 07 November 2013 - 04:28 AM

Try different include order and do not to use "using namespace ..." (if you have any in your .cpp).

#5107603 Vertex weights not properly passed to shader

Posted by Zaoshi Kaba on 06 November 2013 - 11:39 PM

It shouldn't affect other shader. Are you sure you're setting right input layout/shader when you render?

Did you change both, shader and IA?

#5106896 How do I record my game programs

Posted by Zaoshi Kaba on 04 November 2013 - 06:26 AM

Depending on your PC, NVIDIA's ShadowPlay feature (new in the later versions of NVIDIA GeForce Experience) might also be an option.

I haven't tried it personally, but it might be worth looking into.

I've tried it. Haven't tested high-end games, but the ones I did test had no performance impact at all. File size depends on what's recorded though; had 4 minutes and 22 minutes of recordings, both at 1.7 GB (1080p @ 60 FPS).

#5105138 different colors when using XMVECTOR or XMFLOATs

Posted by Zaoshi Kaba on 28 October 2013 - 02:24 PM

Just making sure... XMFLOAT3 and XMVECTOR are different size, did you change input layout & vertex strides to match that?

#5104784 DirectX rendering procedure

Posted by Zaoshi Kaba on 27 October 2013 - 09:42 AM

Is short, you setup rendering states: render targets, render states, textures, buffers, other things, and then draw. After that you need to change only what changed.

So lets say if you have 100 different models that use same textures/everything your loop would look like (pseudocode):

context->SetIndexBuffer() // assuming index buffer is identical
for(...) {

#5104010 Just released some small project that I have

Posted by Zaoshi Kaba on 24 October 2013 - 01:02 AM

This is just my personal opinion and nothing constructive.


I hate boost, therefore I think this is a terrible idea to use boost for a library you're going to distribute. One of reasons is, to compile your 10 KB program I need to download 50+ MB boost libraries; that's just silly.


I noticed some weird things with your includes:

// you are using
#include <boost/unordered_map.hpp>

// but probably all compilers have unordered_map in Standard C++ Library (SCL)
#include <unordered_map>
// another boost include
#include <boost/filesystem.hpp>

// won't complain about this one, but kind of a tip
// Visual Studio 2013 has this include in SCL, don't know about other compilers
#include <filesystem>
using namespace std::tr2::sys;

Your PIUArchiveImpl::write() method (and others) print to standard output, that's unacceptable, use callbacks if output is possible.

#5103744 Matrix Multiplication Order

Posted by Zaoshi Kaba on 23 October 2013 - 09:44 AM

Try this:

float4x4 matFinal = mul(matProj, mul(matView, matWorld));

But it's probably better to transform vertex thrice:

position = mul(matWorld, position);
position = mul(matView, position);
position = mul(matProj, position);

#5102785 Depth Buffer rendering nothing

Posted by Zaoshi Kaba on 20 October 2013 - 02:00 AM

1. world_z_min cannot be 0. Use 0.1f or something similar.



g_pImmediateContext->Draw(sizeof(vertices), 0); 

sizeof() returns size in bytes, but Draw() call requires number of vertices, use ARRAYSIZE() macro.

#5102782 Depth sorting issue

Posted by Zaoshi Kaba on 20 October 2013 - 01:55 AM

You create DXGI_FORMAT_D24_UNORM_S8_UINT texture (32 bit) why your DSV is DXGI_FORMAT_D32_FLOAT_S8X24_UINT (64 bits) that's why it doesn't work.

If need Stencil and still want to use that texture format then I think DXGI_FORMAT_D24_UNORM_S8_UINT is the right choice for DSV.

You can also pass nullptr for 2nd parameter in CreateDepthStencilView() call, it'll use default values which shouldn't fail.