Advertisement Jump to content
  • Advertisement


Senior Moderator
  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by Promit

  1. You're computing your fragment position in view space, but your light is presumably defined in world space and that's where you leave it. Personally I find it much easier and more intuitive to do all my lighting in world space rather than the old school view space tradition. Just output position times world into the shader, and then everything else will generally already be in world space.

  2. There are a couple ways to approach this. The simplest, as mentioned above, is to simply implement the deformation effect in the vertex shader. If you're dealing with a simple one in, one out style of effect then this is a great way to do it and this is how skinning for example is done.

    The next step up in sophistication is to not supply the vertex directly to the vertex shader, but to give it access to the entire buffer and use the vertex index to look up the vertices in a more flexible format. (Some GPUs only work this way internally.) That way your vertex shader can use multiple vertices or arbitrary vertices to compute its final output.

    The most complex version of this is to write a buffer to buffer transformation of the vertices, which can either be done via stream out in the simple cases or a compute shader in the advanced cases. This lets you store the results for later, not just compute them instantaneously for that frame.

  3. 1 hour ago, turanszkij said:

    Should be handled by the driver, but an other thing is that if you still have a pixel shader which wants to write output and no render target is bound, the DX debug layer will begin spamming warning messages, so it's still a good idea to have a null or void PS.

    Oh yeah I forgot about that. I'd blank the shader for that reason alone 🤣

  4. 6 hours ago, Hodgman said:

    You can also pass 0 for the number of views in OMSetRenderTargets -- no need to have a color-render-target bound at all, just use a depth one.

    On top of that, having a NULL pixel shader bound can improve performance further, as mentioned above :D 

    Will setting a NULL pixel shader improve performance even if no color RT is bound? That seems like an easy optimization for a driver to integrate automatically.

  5. As we said on GameDev's Discord (that everyone should join!) what really happened here is that Unity tried to strong arm a company for a license fee, didn't get it, and then lost the ensuing PR war when they tried to force the issue. While the resolution is probably a good thing and makes Unity a more transparent business, it's alarming that things went this way in the first place and that Unity tried to leverage someone that hard. Improbable really came out on top by being savvy with social media and forging a strong alliance with Unreal and Tim Sweeney to back them up on it.

    I'm not inclined to the charitable interpretation of Unity making a mistake here or Spatial doing something that was actually an offense. I think Unity wanted a cut from a certain class and thought they could get it.

  6. The absolute easiest thing to do is to use an archive library like PhysFS to read files like those, maybe with password protection enabled, although it's limited to some common formats that people will generally know how to work with. You could go in and make a modified version of one of the formats that is similar but different enough to require different parsing, though now you'll need to make a tool to output that too. Another option would be to layer some encryption into the files inside the package, and that can range from simple to complex.

  7. I see you're in India, so I am not entirely sure how much of this advice will apply. But typically at least in the US and several other countries, there are programs to get a graduate degree by taking evening and online classes in some combination. So you might have classes Monday and Wednesday 7-9 pm. From there, it's just about discipline and busting your ass doing all the work, because it doesn't come easy. You would likely take one or two courses each semester, which keeps the workload sane with the pressures of a full time job, and probably requires 2-3 years to complete.

  8. NVIDIA has announced a christmas present with the release of PhysX SDK 4.0 later this month, open sourced under the 3-clause BSD license. The big technical change in the physics engine appears to be the temporal Gauss-Seidel solver, enabling faster and more robust handling of contact points and constraints.

    For full details, please see

    View full story

  9. Just now, Lactose said:

    That would work if you're wanting just the direction, but surely it would prevent being able to use the magnitude as e.g. speed or similar?

    I would say stuff x and y into a vector, and normalize the vector only if its magnitude is larger than 1 (something I've seen with an old/flimsy/faulty gamepad). Like Promit says, atan2 will give you the angle

    We have a lot of code that computes the length of a vector into a separate variable and then divides the vector through to normalize it. Enough that I'm tempted to make an extra helper function just for that usage pattern.

  10. 41 minutes ago, Fulcrum.013 said:

    Ok. As we know any programm directly or indirectly implements a state machine. If machine A have n states and machine B have m states together it have n+m states. But machine C that have action equal to both machines same time have n*m states. So then tinyest universal pieces used to decomposite task then shorter and simplier code it required totaly.  So deep task analisis and high-level abstraction is much simple way to get ready solution then "just code as something who know nothing in task fields sayd". Also do not forget that any component that you code today become to your tool tomorrow. So universally designed components just a way to make something for cost of couple machine-seconds of template instantination instead of human-years of coding. Really good programmer - is a lazzy programmer, becouse prefer to do short universal code that allow to shorten depnded code at least twice in comparsion with "Focus on the exact things you need to actually produce". Becouse only mind of lazzy programmer - is to make architecture/components that make for him 99% of his job. Fnd really it as result allow to spent other couple machine-seconds of template instantination instead of human-years of coding witout analizing a task.



    Do you have any game development experience?

  11. Speaking as a member and not a moderator, these are the things I'd like to see:

    • All politics threads must have some kind of plausible connection to games or the game industry. Sorry but most of your guys' opinions are terrible and I've grown tired of reading the latest stupidity.
    • Minimum reputation to even participate in political threads, and I'm not thinking small here. Perhaps a hundred points. Alternately minimum post counts/account ages? Either way, I believe that new accounts should have no right to participate.
    • An understanding that stepping out of line in these threads is grounds for an insta-ban, much more readily than we might normally do so.
    • I don't think we've had much of a problem with this yet, but there are certain domains/sites I would blacklist, and YouTube links should be off limits as well. You all know why.
    • An outright explicit ban on threads that touch on race, gender, sexuality. Nothing good can come of these discussions.

    As a moderator, I'd very much like the ability to force particular members out of political threads permanently. We've seen an influx of people lately who kinda sorta do some game stuff here and there but mostly have an axe to grind on political ideology and just can't help themselves. A couple are already in this thread.

  12. It all depends. GLUT is ancient and irrelevant, but several other foundational libraries are perfectly viable as long as they're open source. The real issue nowadays is that graphics APIs are changing, platforms are coming and going, and professional studios need to be buffered against all of those changes. A math library needs to be flexibly ported to different CPU architectures with different SIMD instruction sets. Windowing libraries need to be expandable to handle platforms that may not even be publicly announced. You can't very well have MS come to you for an Xbox 4 demo and not be able to adapt to the platform.

    For those reasons, these core libraries can act as very short term gains, but in the long view it's more beneficial to control the underpinnings yourself.

  13. 15 hours ago, gaxio said:

    You've strayed far, far into DIY territory and something that's not even practical or even in wide use in game development.  You will find generic information about assembly language programming, of course, but you won't really find anything about game development.

    I have to add some caveats in here. True, nobody builds games in assembly. But there are certainly uses for it. It's still common to write SIMD routines in assembly, especially newer instruction sets where the compiler intrinsic support is either not available or just doesn't work that well. PS3 SPUs were frequently coded in assembly. And debugging often involves going over the assembly code being emitted and run, in order to understand what's going on. Performance optimization also frequently requires analysis of the compiler output to fully achieve the desired results. 

    We're not writing in assembly or even reading it on a regular basis, but you better believe that it comes up plenty in games.

  • 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!