Jump to content

  • Log In with Google      Sign In   
  • Create Account

Zaoshi Kaba

Member Since 04 Nov 2012
Offline Last Active Today, 02:05 PM

#5199386 How was my operator overload working when I forgot to return *this

Posted by Zaoshi Kaba on 21 December 2014 - 04:06 AM

Some bugs have a mysterious way to sense release date and crash the software just before that.

Schrodinger's bug.

#5196233 Win 10 Tech Preview Visual Studio 2015 and Direct2D tutorial

Posted by Zaoshi Kaba on 04 December 2014 - 06:21 AM

There's no attachment so I'll just list typical problems:

  1. DirectX SDK comes with Windows SDK, which comes with Visual Studio. This means you don't need to install SDK separately. Visual Studio is all you need to use DirectX. If you have old SDK you will have to remove it;
  2. Microsoft got rid of D3DX, which had texture loading, meshes, and a lot of other stuff. Therefore you have to implement these yourself and old samples don't work anymore. There's DirectX Tool Kit but I think you'll still have to make some changes to make D3DX code work;
  3. DXUT is gone as well, which heavily relied on D3DX and been used in a lot code samples;
  4. Math API has been updated, so old D3DX math functions don't work. See DirectXMath.h include and MSDN.

#5186753 normal map generating

Posted by Zaoshi Kaba on 13 October 2014 - 02:02 PM

This is very possible.


This has been discussed in some other topic.

It is possible but it won't be real normal map. You'll just end up with some fake effect which most likely be on a scale from bad to terrible.

#5186738 normal map generating

Posted by Zaoshi Kaba on 13 October 2014 - 12:23 PM

You cannot make normal map like that.

#5185959 Formula for Exponential Growth

Posted by Zaoshi Kaba on 09 October 2014 - 05:02 AM

Looks about correct:




y = 10 ^ (2 ^ ((x - 1900) / 2 / 28) * (70 / 12) - 10)

Where x is 1900 to 2100.

#5185929 Formula for Exponential Growth

Posted by Zaoshi Kaba on 09 October 2014 - 02:55 AM

It's exponent with certain scaling on both axes.

Red dots represent computing power which follows Moore's Law (x2 every 2 years).

e^x also has similar shape.


I think you're overcomplicating problem by trying to create function based on data instead of making a guess based on visual information.

Not to mention you have no accurate data to begin with.

#5185114 Two Questions about DirectX 11 (XMVECTOR & Creating Input Layouts)

Posted by Zaoshi Kaba on 05 October 2014 - 07:16 AM

If you pass pointer you'll have to load value from memory by pointer, however if you pass your vector by value there's a good chance it will be passed in register and you won't need to access memory, which is way more faster and efficient.

#5181103 c++ Performance boost needed

Posted by Zaoshi Kaba on 17 September 2014 - 02:12 PM

  1. Yes, operator[] is a little slower, especially if you have exceptions/etc turned on; it checks whether range is valid, etc. However your loop isn't big enough to make a any noticeable difference.
  2. std::clock() has horrible accuracy. Even if there is performance difference you won't notice until it's huge or it'll round wrong way giving invalid data, ex. execution time can increase by 1% by rounding will change from 16ms to 32ms. Pointers aren't "faster" or "slower", however when misused they definitely can be slower because of cache misses.
  3. I have suspicions that your handConflictsBoard() function passes values instead of references, thus copying a lot of data when it's not necessary which is likely source of your slowdown.

​If you want to make your code faster first you need to figure which part is the slowest and then see how you can improve it. Optimizing random code parts isn't likely to give significant difference.

#5180215 Preprocessor query

Posted by Zaoshi Kaba on 14 September 2014 - 04:45 AM

Won't this turn __COUNTER__(a) into a string instead of calling macro and turning result into a string?


There's some command line parameter to output preprocessed file, that way you can see result you're getting instead of playing guessing game.

#5179813 Which algorithm is more efficient for visibility culling? BSP or OCTree?

Posted by Zaoshi Kaba on 12 September 2014 - 02:56 AM

brute force, just iterate over the set of renderables and cull them against the view frustum. Even better, pack the bounding boxes with handles back to the owner into an array and iterate that much more cache efficient, minimal branching (in fact, you can delay branching till the end in most cases).


To backup Washu I can say I've done thesis on view frustum culling and bruteforce method culls 340,000 AABBs in 1 millisecond. If this isn't sufficient you might have different problems.

#5177680 For-loop-insanity

Posted by Zaoshi Kaba on 02 September 2014 - 10:51 AM

Since we are trying to come up with new, obscure, and complicated ways for counting up, how about this

Somehow I can see Java programmer actually doing this.

#5177206 Font Rendering Woes (FreeType)

Posted by Zaoshi Kaba on 31 August 2014 - 08:19 AM

Are you sure this is not .jpg artifact? I'm not sure how good quality is on those.

#5175284 DirectX with or without Visual Studio 2013

Posted by Zaoshi Kaba on 21 August 2014 - 08:52 AM

D3DX is Direct3D Extension, which included texture loading and other things, it's not DirectX API. It has been removed in some version and you have to implement that yourself.

I think DirectX Tool Kit implements most things D3DX used to have.

#5174257 Thesis idea: offline collision detection

Posted by Zaoshi Kaba on 17 August 2014 - 07:13 AM

I don't feel this is possible.

You'd need 2 transformation matrices per situation. Even if you do accuracy of 1 degree you get 360 * 360 * 360 = 46,656,000 combinations. Add to that matrix size of 16 * 4 * 2 = 128 and it's suddenly 6 gigabytes of data and you still haven't taken into account translation or scaling.


Unless I have wrong idea...

#5172366 How to make 3D Character move to a specific point

Posted by Zaoshi Kaba on 08 August 2014 - 04:28 PM

You should figure vectors; it's along the lines of:

difference = destination - position;
direction = normalize(difference);
movement = direction * move_speed;