Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

114 Neutral

About barsiwek

  • Rank
  1. Hi everyone,   XNAMath has a lot of useful structures for loading data into the mapped constant buffers. Like casting the appropriate piece of memory the XMFLOAT4A* and then assigning to it does the job. What I cannot find is the data structures that allow me to do the same for double4, double4x4 and similar entries in constant buffers. What is the best way to do that?
  2. Thanks for the answers, so I guess this blog post is totally wrong? EDIT: Just remembered this was about constant buffers. Carry on.
  3. Hm... I had someting else in mind - what HLSL types are allowed in the Shader code. So - can I have 'float4' in the input struct? Yes as far as I know. Can I have a 'sampler'? Probably not. Some specification that can answer this questions is what I'm looking for. Hmm... This helps a bit. I know that if the VS input is for example: struct VSInput { float a : A, float b : B, float4 pos : POSITION } Then I need 8 bytes of padding after the 'B' data in vertex buffer, which means that position must be 16 bytes aligned I guess?
  4. Hi everyone, I'm having no luck locating the following information on MSDN (or anywhere in that matter) and I was hoping that someone could help me. First of all - is there somewhere a specification of what HLSL types are allowed as inputs to vertex shader (a.k.a. vertex attributes)? Secondly - is there a specification how the above types are suppose to be aligned in the memory on the application side, so that everything works out?
  5. Wow! Thank you Erik for the code and MJP for reference. Microsoft should work a bit on their documentation - I did a bunch of searching on MSDN and did not come over this article at all :/
  6. I want to try out different formats for storing normals at vertices and compare quality to pick the one that suits me the best. Most formats are either simple to pack to have functions that do that for you (for example - D3DX_FLOAT4_to_R10G10B10A2_UNORM). With this one I do not know how to do it correctly. I was hoping on a description how to do it on application side (in C++ for example) - so I can store this in a binary file for fast loading later.
  7. Hi everyone, I would like to ask how to properly pack values of a vertex normal using DXGI_FORMAT_R11G11B10_FLOAT format. My input, per vertex, is a 3 dimensional vector with components in range [-1,1] stored in 32bit floats. I do know that I have to scale that into the [0, 1] range since there is no signs in R11G11B10 format, but what am I suppose to do after? I can extract the exponent and mantisa but is truncating them bitwise the right way to go?
  8. This remibds me of an blog post that I read a while ago about simulating closures in HLSL. As far as I rember it works on SM 3.0 and up.
  9. Ok so... You can have two situations: 1) you have the points in space (say 3D) with their parameter values preassigned 2) you have just the points in space. In the first case the situation is straight forward - you just proceed as the article says, that is for each parameter interval you normalize it to (0,1) and the use the formula you posted. In the second case you need to parametrize the data and there is no "one way" of doing it as different metods give different results. Try to google for "uniform parametrisation", "chord lenght parametrisation" and "centipetal parametrisation".
  10. barsiwek

    Any PhD's in the house?

    Well my idea would be to make a blog/library/portfolio of code samples that implement various techniques/algorithms etc. Maybe a small game. I know that is definitely too much work for one persons spare time to make a complete graphics engine from the scratch. You think that will help?
  11. barsiwek

    Any PhD's in the house?

    Now I need to ask a question cause the OP's post is almost exactly my case and the answers got me worried a bit. I'm halfway through PhD program right now and I would really do graphics programming after I'm done. My research field is not 100% relevant (computational mathematics) but I do have a 1.5 years of experience a as "standard" software engineer and two master degrees (Math and CS). So my question is - am I destined to be stuck in academia? I still do coding and plan on building up a samples library in a form of a blog (sth. like what _Humus_ has done) - will that help? Maybe I should try for an internship at some point?
  12. barsiwek

    Iteration hell

    How about a Strycture-of-arrays approach instead og Array-of-structures?Split the data into two vectors (preallocated, fixed size arrays would be better): class Object { D3DXVECTOR3 v_position; }; std::vector<Object*> objects; std::vector<uint32> visibility; Now each bit in visibility vector determines the visibility of the one object, you can clear the whole thing with memset and it's better for cache as long as visibility is used more often than the rest of data.
  13. barsiwek

    Expecting calculation to be 0

    I'll throw in my two cents with these two tutorials (I always felt they aren't popular enough):
  14. barsiwek

    SAT bouncing resolution

    Hi again, I'm not sure the exact source of your problems but normals from your debug output look a bit strange. For example both vertical sides of the large rectangle in the bottom of the screen give (1, 0) normal. One of them (left I think) should have a (-1, 0) normal.
  15. barsiwek

    Fourier Transform questions

    e^-i = e^(-1)i = cos(-1) + isin(-1) = cos(1) - isin(1) e^i = e^(1)i = cos(1) + isin(1) Which one gets normalized is a convention. You could multiply the normal one instead of dividing the inverse one. The reason you have to do it is (vaguely) because when going from time domain to frequency domain your "unit of measure" changes from s to rad/s.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!