Jump to content

  • Log In with Google      Sign In   
  • Create Account


Zaoshi Kaba

Member Since 04 Nov 2012
Online Last Active Today, 03:06 AM

#5163818 very strange bug (when runing c basic arrays code)

Posted by Zaoshi Kaba on 30 June 2014 - 06:51 AM

100*1000 is 100,000 elements, 6 such arrays make 600,000 elements 4 bytes each, that's 2,400,000 bytes or over 2 MB. That's bigger than default stack size, that's why you get crash. Use new[] operator for those arrays and it'll work just fine.




#5162072 Why do we need to iterate data structures as they are already in RAM

Posted by Zaoshi Kaba on 22 June 2014 - 06:29 AM

I'm not sure I understand correctly. Are you asking why we have to look at all values in the array while searching for the one we need?

Imagine with stack of paper pages with just 1 word on each and you need to find page with specific word. You cannot take it out on first try, so you look at all pages 1 by 1 until you find what you need. Same principle is here.




#5156334 Best comment ever

Posted by Zaoshi Kaba on 27 May 2014 - 01:49 PM

You can find more at http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered




#5136903 Visual Studio 2013 Graphics Debug

Posted by Zaoshi Kaba on 06 March 2014 - 12:11 PM

Visual Studio 2013 comes with Direct SDK built-in into Windows SDK.

In other words, you need only VS2013. Uninstall your DirectX June 2010 SDK (or whatever month it is).

However keep in mind that you will lose D3DX, which includes texture loading & other stuff.




#5133495 version of the offline shader compiler

Posted by Zaoshi Kaba on 22 February 2014 - 05:09 AM

Microsoft stopped developing DirectX SDK as separate thing. It now comes with Visual Studio 2013 build-in into Windows API. I'm afraid you'll have to download it if you want newer compiler.




#5131806 Map texture for reading problem

Posted by Zaoshi Kaba on 16 February 2014 - 02:38 PM

Depending on driver, GPU and other things there might be some padding. Sometimes till power of 2, sometimes till multiple of 2 or other number.

In short 800 * 4 bytes are pixel data, next 128 bytes are unused, then next row starts.




#5128136 Data of texture

Posted by Zaoshi Kaba on 02 February 2014 - 05:54 AM

You're on the right track, however, what exactly isn't working? Does it crash, silently fail, etc?

 

  1. I'm not sure if it's possible to use D3D11_BIND_SHADER_RESOURCE flag with D3D11_USAGE_STAGING, try to set bind flags to 0.
  2. You have different number of mip levels, it might be unable to copy data because of that (I've failed to find info on MSDN).
  3. 400x400 texture isn't power of 2, therefore it's most likely bigger than (td.Width * td.Height), use D3D11_MAPPED_SUBRESOURCE::RowPitch value for "width".



#5121097 Animatian data: disk versus memory

Posted by Zaoshi Kaba on 04 January 2014 - 04:14 AM

7x 50,000 floats is only 1.4 MB. That might become a problem only if you'll have thousands of such animations.

Reading next frame from disk all the time is one huge disadvantage: disk IO is very slow, plus it puts extra wear on it.




#5119292 Simple draw command not working.

Posted by Zaoshi Kaba on 26 December 2013 - 08:18 AM


is this what mine should be like instead?

That should do it. Does it work yet?

If not try to enable (if not yet enabled) debug layer. Debugging will cause D3D to throw messages into Visual Studio if any problems arise.




#5119205 Simple draw command not working.

Posted by Zaoshi Kaba on 25 December 2013 - 11:12 AM

  1. I cannot see ID3D11DeviceContext::OMSetRenderTargets() call
  2. Vertex & Pixel shaders might contain problem as well, would be useful to see them
  3. Graphics::createVertexBuffer creates buffer but doesn't save it to variable like you imagine; it needs pointer reference or double pointer



#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.






PARTNERS