Advertisement Jump to content
  • Advertisement
  • Advertisement
  • What is your GameDev Story?

    In 2019 we are celebrating 20 years of! Share your GameDev Story with us.

    (You must login to your account.)

  • Latest Featured Articles

  • Advertisement
  • Popular Now

  • Similar Content

    • By sdidsa
      not sure if this is the right place to ask, but i have made a certain simulation with JavaFX 3D API and it's working very well so far,
      now i wanted to implement 3D shadows and i wasn't able to find any articles or help, i had to read a lot of articles about 3D shadow mapping algorithms but i wasn't able to apply anything on my JavaFX project
      i already assumed that it's impossible but if anyone of you have tried that, let me know
    • By HolyOdin
      I have recently read an article( ,which was very informative for me。however,there weren't too much details about how the derivatives actually work by explaining them pixels by pixels under the group, only one example was shown there which was too intuitive. but when i came to other pixels in the group, things got really tricky and confusing.for better illustration of my question, Let's just take an example here, say, i have a rendertarget like this:

      According to the article,the horizontal derivative for some value in pixel[0]  is obtained by subtracting the value itself from the correspondence in pixel[1]. Since they are in the same group ,both values can be easily fetched.Great!but how about pixel[1]? if same rule is applied the horizontal derivative should be calculated base on pixel[1] itself as well as the value in pixel[2]. but at this time the two pixels are in diffrent groups! similar situations accured when you perform the vertical derivative for pixel[4]. Well, i was originally thinking maybe there was some fancy driver features that can make it happend. unfortunately the result was not what i expected after i made some experiment.
      this simple code below failed my assumption:(you can test it and see the result in shadertoy your self )
      void mainImage( out vec4 fragColor, in vec2 fragCoord ) {     int oddRow = int(fragCoord.x) % 2 == 1 ? 1 : 0; //fragCoord是屏幕空间坐标     float xDerivative = dFdx(float(oddRow));     fragColor = vec4(xDerivative,xDerivative,xDerivative, 1.0); } if my supposition is correct, the screen shoud be alternated with white and black tiles alone the horizontal direction like this:

      but the result is pure white which is surprisingly not the case.
      So,can anyone shed some light about this problem for me. i also goggled a lot of places with no luck, all of them told you the pixels were handled in such a way, but no one really focused on specific situations as i have mentioned above.I think anyone who works with ddx ddy should absolutely have an clear understanding of this.
      Much appreciation!
    • By babaliaris
      I'm currently learning how the depth testing works in OpenGL from these tutorials and the tutorial says that
      By default the depth function GL_LESS is used that discards all the fragments that have a depth value higher than or equal to the current depth buffer's value. If i guess that the depth value it the z coordinate that I pass through the vertex data, then the above statement should not be true. Fragments with small Z values should be discarded because the depth is towards the -Z axis not fragments with higher z value. Does the depth values are created somehow else by using the z coordinate of the fragment? So the depth value is a number from 0...N so lets say a fragment has a depth value of 5 and the one that is behind it has 10, the 5 will pass the test?
    • By isu diss
      How can I find collision point and normal using sat? I read that sat can do that. Please help me?
      int AABB::supportFaceCount() { // there are only three directions for every face of an AABB box. return 3; } XMVECTOR AABB::supportFaceDirection(int i) { // the three axes of an AABB box. along the x, y and z axis. static const XMVECTOR s_aabbAxes[] = { XMVectorSet(1, 0, 0, 0), XMVectorSet(0, 1, 0, 0), XMVectorSet(0, 0, 1, 0) }; return s_aabbAxes[i]; } int AABB::supportEdgeCount() { // there are only three directions for every edges of an AABB box. return 3; } XMVECTOR AABB::supportEdgeDirection(int i) { // every edge go along the x y, or z axis. static const XMVECTOR s_aabbEdges[] = { XMVectorSet(1, 0, 0, 0), XMVectorSet(0, 1, 0, 0), XMVectorSet(0, 0, 1, 0) }; return s_aabbEdges[i]; } void AABB::supportInterval(XMVECTOR direction, float& min, float& max) { XMVECTOR centre = XMVectorSet(Center[0], Center[1], Center[2], 1); // projection of the box centre float p = XMVector3Dot(centre, direction).m128_f32[0]; // projection of the box extents float rx = fabs(direction.m128_f32[0]) * Radius[0]; float ry = fabs(direction.m128_f32[1]) * Radius[1]; float rz = fabs(direction.m128_f32[2]) * Radius[2]; // the projection interval along the direction. float rb = rx + ry + rz; min = p - rb; max = p + rb; } bool ObjectsSeparatedAlongDirection(XMVECTOR& direction, AABB* a, AABB* b) { float mina, maxa; float minb, maxb; a->supportInterval(direction, mina, maxa); b->supportInterval(direction, minb, maxb); return (mina > maxb || minb > maxa); } bool ObjectsIntersected(AABB* a, AABB* b) { // test faces of A for(int i = 0; i < a->supportFaceCount(); i++) { XMVECTOR direction = a->supportFaceDirection(i); if(ObjectsSeparatedAlongDirection(direction, a, b)) return false; } // test faces of B for(int i = 0; i < b->supportFaceCount(); i++) { XMVECTOR direction = b->supportFaceDirection(i); if(ObjectsSeparatedAlongDirection(direction, a, b)) return false; } // test cross product of edges of A against edges of B. for(int i = 0; i < a->supportEdgeCount(); i++) { XMVECTOR edge_a = a->supportEdgeDirection(i); for(int j = 0; j < b->supportEdgeCount(); j++) { XMVECTOR edge_b = b->supportEdgeDirection(j); XMVECTOR direction = XMVector3Cross(edge_a, edge_b); if(ObjectsSeparatedAlongDirection(direction, a, b)) return false; } } return true; }  
    • By Alladin
      Got an amount of inspiration and made this game. It's humoristic and satiric, so don't take it too seriously)
      Here you play as a priest and your main task is catching the kids. Steam store page:
      Gameplay trailer:
      If you have any suggestions, advice or something else, write here)

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!