• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By lxjk
      Hi guys,
      There are many ways to do light culling in tile-based shading. I've been playing with this idea for a while, and just want to throw it out there.
      Because tile frustums are general small compared to light radius, I tried using cone test to reduce false positives introduced by commonly used sphere-frustum test.
      On top of that, I use distance to camera rather than depth for near/far test (aka. sliced by spheres).
      This method can be naturally extended to clustered light culling as well.
      The following image shows the general ideas

      Performance-wise I get around 15% improvement over sphere-frustum test. You can also see how a single light performs as the following: from left to right (1) standard rendering of a point light; then tiles passed the test of (2) sphere-frustum test; (3) cone test; (4) spherical-sliced cone test

      I put the details in my blog post (https://lxjk.github.io/2018/03/25/Improve-Tile-based-Light-Culling-with-Spherical-sliced-Cone.html), GLSL source code included!
    • By Ty Typhoon
      ...if you got time to read and answer i would be happy . 
      So me and my co try to do a game.
      It should be in unity couse my co do everything in this engine.
      We got the rpg package from evila for inventor, but it only runs on pc right now.
      I like to make a online store for guns in the game and a multiplayer open world that runs on pc, android, mobile, ps4, xbox one. 
      Somebody told me that you "only" need to program it like so and that its possible in every engine...
      So if you are one of the lucky guys who could help me out or programm that, or even if you know a newer better package for maybe unreal which offers that - please let me know now.
    • By Octane_Test
      I am developing a mini golf game in Scenekit. I have applied dynamic physics body to the ball and static physics body to the grass surface and the brick walls show in this image.
      When I apply the force to the ball, the ball’s linear and angular speeds change as shown in the graphs.  The ball’s speeds don’t reduce to zero (so that the ball can stop) but remains constant after certain value.
      Ball linear speed graph
      Ball angular speed graph
      Analysis Tests:
      When I increase the values to both the rolling friction and the friction, the ball speed is reduced quickly but remains constant after certain value (similar to the above graphs). When I increase the values of the linear damping and the angular damping, the ball speed behavior is same as the point #1. When I set the gravity value to -9.8 m/s2, the ball’s linear speed remains constant after 0.1 m/s. If I reduce the gravity value to -5 m/s2, the ball’s linear speed remains constant after 0.05 m/s. The friction, linear friction, linear damping and angular damping are same throughout the motion of the ball.
      There is 1 millimeter overlapping between the ball and the surface of the golf course.
      From the analysis test #3, I think the gravity is causing the constant ball speed issue. Is my assumption correct? If yes, how can I fix the issue? I can’t remove the gravity field as without the gravity field the ball will not roll along the grass and it will slide. Why the friction and the damping properties are not affecting the ball speed after certain value?
      Are there any other physics properties can cause such issue?
      From the analysis test #5, are there any chances that the ball is receiving upward push to correct the position of the ball?
      If I increase the physics timestep from 60 FPS to 200 FPS, the issue is resolved. I am not able to understand how this change can fix this issue? After reducing the gravity value to -1 m/s2 and physics simulation speed to 4 (4 times fast physics simulation), the issue is fixed. Again, I am not able to understand how this change fix the issue? I would appreciate any suggestions and thoughts on this topic. Thank you.
    • By stale
      I'm continuing to learn more about terrain rendering, and so far I've managed to load in a heightmap and render it as a tessellated wireframe (following Frank Luna's DX11 book). However, I'm getting some really weird behavior where a large section of the wireframe is being rendered with a yellow color, even though my pixel shader is hard coded to output white. 

      The parts of the mesh that are discolored changes as well, as pictured below (mesh is being clipped by far plane).

      Here is my pixel shader. As mentioned, I simply hard code it to output white:
      float PS(DOUT pin) : SV_Target { return float4(1.0f, 1.0f, 1.0f, 1.0f); } I'm completely lost on what could be causing this, so any help in the right direction would be greatly appreciated. If I can help by providing more information please let me know.
    • By Sandman Academy
      Downloadable at:
  • Advertisement
  • Advertisement

Tried To Learn The Hard Way

Recommended Posts

I am a newbie programmer trying to learn game programming. I have had minimal experience with python so i wanted to learn the basics of C++ because I've heard its the best for game programming. I then read a primer book and made a quite robust little object oriented text game (at least where text games are concerned for me.) After having no success in finding a way to learn 2d game programming with C++ I dived headfirst into learning C++ 3d game programming with books like "Introduction to 3D Game Programming With DirectX11" and "Game Coding Complete." I am having trouble taking grasp of the concepts put forth in the book like 3d and object oriented encapsulation for hierarchies for game objects and that kind of stuff.  My question is what should I read or do to understand these things better that's comprehesible and easier to get into pertaining graphics and structure. I just want to make a simple game maybe pong or something not some crazy 3d matricy vertex rendering collision physics lighting mumbo jumbo, at least not at first. Should I look more into python pygame stuff or Unity? Or is there hope for beginners in C++?

Share this post

Link to post
Share on other sites

Have you considered learning a engine?


A tutorial on how to render a sprite with C++, will give you more info than a book on programming games.

Here is one for you: https://learnopengl.com/#!In-Practice/2D-Game/Rendering-Sprites

A book is like a large summary, it isn't focused on one part. Instead you should just learn what you need step by step.


A good idea is to think of what you need to do next, then to just learn that part first.

Share this post

Link to post
Share on other sites

C++ isn't fast by itself. It has the potential to be fast in the hands of a skilled and experienced programmer that knows how to make the computer dance. Since you don't yet have that knowledge, C++ is perhaps more a hurdle than an advantage for you.

That high speed comes at the cost of everything else, like nice error messages, memory management, and a smart programming language that tries to help you.


If you want to pursue in C++ anyway, it doesn't come with tons of libraries to do just anything you may want to do. They have chosen to fill that gap with 3rd-party libraries. So there are 2D libraries available on the net, such as SDL2, or Allegro (haven't looked at that in a decade or so).

There are also tutorials for such libraries, like http://lazyfoo.net/tutorials/SDL/index.php


The Python version of the above library is called Pygame at pygame.org . The interface to SDL is a lot simpler in that case, not to mention Python is much more beginner friendly, so you may want to go that route.


Share this post

Link to post
Share on other sites

If you aren't interested in the nitty gritty of "crazy 3d matricy vertex rendering collision physics lighting mumbo jumbo". Take a look at game engines. Unreal might be the right choice for you since you have a C++ background, but I'd also consider Unity. Spend a weekend with both and see which one you like better. 

- Eck


Share this post

Link to post
Share on other sites

So, remembering back to when I started to code I got into it kinda like how you seem to be, I jumped into some books - Ironically was the DX9 version of the DX11 book youre reading pretty sure based on the title.

Things do seem to get pretty confusing pretty fast when you jump straight into working on stuff like that at the books tend to introduce / use a concept and then move on a lot of the time - so a good thing is to take it slow when working through them, even re-do exercises to make sure you totally understand them etc, but C++ is a big, hefty language with a lot of things you can do wrong so it can be a slow learning process.

In terms of you mentioning struggling with like objects / hierarchies, there was something I read in a book once (cant remember which) that was pretty simple advice but really did help - Objectify everything you can, even just in day to day life - Basically, just in things you use daily try to think about how they could relate etc for example a Pen and a Pencil, they share a lot of things, could be grouped into Writing Tools etc.

But there is always hope for people who learn to code in C++, its what I encourage people to learn to code in, because its one of the least forgiving to learn so if you can master it.. you can basically code in anything ;p (trial by fire eh?)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement