Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

236 Neutral

About RichardGe

  • Rank

Personal Information

  • Role
  • Interests
  1. RichardGe

    algorithm challenge

    wow very interesting, I just read quickly the 2 articles. I think you pointed exactly what I was searching. I'll try to find more time later to take a closer look, and implement something.
  2. RichardGe

    algorithm challenge

    @alvaro , even if we don't care of memory, if N and K are very big it could take years to fill the C[N][K] array . But for decent N and K it seems it's working @frob, I had no knowledge on the Fisher-Yates shuffle, but it looks like it's using several random numbers... However you can tell me that I told "Random function can manage numbers of any size you want", so we can generate small random numbers from a big number. Concerning your algorithm, I assume it's working correctly even if some indices are equal in the first step, so I think it would work too, with a very big initial random to generate the list of indices. In all the cases, it seems we need something big to initialize the algorithm. I don't know if we can do it, only with 1 initial random number R between 1 and binomial(N,K), I mean this is the number of possibilities. and then with a smart algorithm, have the Rth combination. (without iterating throw all combinations).
  3. RichardGe

    algorithm challenge

    no it's from my mind
  4. RichardGe

    algorithm challenge

    Hi, little challenge I was thinking... you have a lotto grid of N numbers. you have to pick K different numbers. order doesn't matter. my challenge : write an algorithm that generates 1 random pick combination. example with N=6 and K=3 , 1 pick would be (1,3,6) constraints : - you can call Random function only 1 time. ( this Random function can manage numbers of any size you want ) - N and K are very big - I mean, you can't iterate all the possibilities - all pick combinations must have the same chance to be generated on my side, I think I have an idea of solution, but I'm not happy with it, because it would imply some complex looping. I assume the start is to generate a random number between 1 and binomial(N,K)...
  5. RichardGe

    binary alpha

    Hodgman, thanks for the fast solution. C0lumbo, thanks for the interesting details.
  6. RichardGe

    binary alpha

    Hi,   In order to avoid the need of sorting the objects that need a simple binary alpha mask, I'm forcing  the alpha transparancy to be only 0 or 1.       To do that, I have added this line in all my pixel shaders : //force alpha to 0 or 1 if ( finalColor.w > 0.5f ) { finalColor.w = 1.0f; } else { finalColor.w = 0.0f; } This doesn't seem very beautiful. I'm wondering if there is another way to do that ? Like a DirectX implemented feature ?   Thank you !
  7. RichardGe

    Animation & normals

    Thanks clb! Now, I understand the previous disagreements!
  8. RichardGe

    Animation & normals

    I'm not sure. I hope the Wikipedia article isn't false: http://en.wikipedia....thogonal_matrix "a matrix Q is orthogonal if its transpose is equal to its inverse" if I take a uniform scaling matrix: s 0 0 0 0 s 0 0 0 0 s 0 0 0 0 1 the transpose is the same. But the inverse is 1/s 0....0....0 0...1/s...0....0 0....0...1/s...0 0....0....0.....1 So I conclude that a uniform scaling matrix is not orthogonal ?
  9. RichardGe

    Animation & normals

    Thanks, actually, I made a small mistake: I was wrong: most samples that I found used only orthogonal matrices, so: no need to inverse&transpose! One last thing about orthogonal matrices that I discovered during my research (maybe that will help someone... one day...): In some articles I read that a matrix that contains a uniform scaling is orthogonal (and when we transform a vector, there is no need to inverse&transpose). This is false: the uniform scaling matrix isn't orthogonal! BUT it's almost true: actually, if and only if, we don't care the norm of the vector because we normalize the vector just after the transformation (so in 99% of cases): in this case, even if the matrix contains a uniform scaling (so isn't orthogonal), we don't need to inverse&transpose. This isn't true for non-uniform scaling matrices.
  10. Hi everyone, Question concerning animation: in a lot of samples (even in the official sample "Local Deformable PRT" of the SDK of DX ), I see something like that for animation in vertex shader: struct VS_INPUT { float4 Position : POSITION; float3 Normal : NORMAL; float3 Tangent : TANGENT; float4 BlendWeights : BLENDWEIGHT; float4 BlendIndices : BLENDINDICES; ..... }; VertexShader { .... for (i = 0; i < 4; ++i) { blendPos += float4( mul( boneMatrix[blendIdx] , position).xyz, 1.0) * blendWgt; normal += mul( (float3x3)boneMatrix[blendIdx] , normal) * blendWgt; ....... } ...... } My question is about the normal transformation: I have studied boneMatrix[], and I found that all matrices of this array aren't always orthogonal (certainly because of not uniform scaling). So they should transform the normal with the transpose of the inverse of the matrix. Why in every samples (that use BLENDWEIGHT/BLENDINDICES) that I found, nobody use the inverse of transpose for the normal/tangent transformation? My theory is that it's a big cost to compute/transfert/stock all the inverse matrices, so it's better to have a normal slightly false rather than an exact normal but a lower FPS. Is my theory true? or am I missing something? Thanks!
  11. RichardGe

    A Verlet based approach for 2D game physics

    Very good article! Since a long time I'm searching how to develop a physic engine like Angry Birds. I think this algorithm is a good way to do that. Moreover, I'm sure this approach could be used for a 3D game physic.
  12. RichardGe

    Pipeline state: in HLSL or C++ ?

    OK thanks. To conclude, they are nearly the sames. It's not a question of performance but rather of program architecture (how effects are managed).
  13. Hi everyone I'm wondering what's the difference(s) between defining pipeline states in the C++ program or in the shader program. For example, the difference between pass P0 { ...... SetBlendState( ....); ..... } And that: ..... somewhere in the C++ program .... pd3dDevice->OMSetBlendState(....) .... Is there any performance difference? What's your style (and Why): All states defined in the HLS ? the minimum of states defined in the HLSL ?... Thanks!
  14. RichardGe

    ParallaxOcclusionMapping Error

    Hi, I'm wondering the same question. I didn't found explication in the article... Why don't we multiply the Light and View in the same order ? Edit: anyway, it's not an error, because the directX sample works with that
  • 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!