L. Spiro

Members
  • Content count

    4310
  • Joined

  • Last visited

  • Days Won

    1

L. Spiro last won the day on September 14

L. Spiro had the most liked content!

Community Reputation

25644 Excellent

1 Follower

About L. Spiro

  • Rank
    Crossbones+

Personal Information

  • Interests
    |programmer|
  1. I'm so confused

    Your topic looked like spam to someone. Don’t take it personally. L. Spiro
  2. Goodbye!

    L. Spiro
  3. Shadow Mapping

    You can only pre-bake a shadow map if neither the light nor any objects in the shadow map are moving. Any kind of moving sun is out. Even if your sun is static, you could only bake the cascades if they cover a specific area and never move (with the player, based on where the player looks, etc.) This largely defeats the purpose of cascades, and I can’t think of any cases where it would be useful to bake them. I can’t remember the site, company, or game, but around 7 years ago this idea was published and explained with a demo. You reproject the shadow look-up coordinates in much the same way as you have to reproject the scene for temporal anti-aliasing. It hasn’t caught on since then due to the difficulty in implementing it and all the edge cases that arise that either slow down the routine if handled fully or lead to artifacts if not. As with any reprojection technique, you have problems with things appearing from out-of-view. But it might be suitable for the farthest cascade of a shadow map. We were considering this but did not implement it. If your world is as large as ours in Final Fantasy XV, then your farthest cascade will be mostly blurry and you can get away with not rendering certain things such as small foliage (another optimization I implemented), so if there is a candidate for this type of reduced updating rates it would be that. L. Spiro
  4. Shadow Mapping

    Yes, but unless you pass extra parameters that means all of your shadows have to have the same resolution. I don’t think NVIDIA is different. In either case, sampling a cube map actually emits a series of intrinsics that give the face index and 2D coordinates. Since consoles expose these intrinsics, my routines for Xbox One and PlayStation 4 are instruction-for-instruction exactly the same as a cube sample, except for one extra instruction to increase my Y coordinate based off the face index. My routine for Windows can’t use the intrinsics but should compile to the same thing. I don’t know of any open-source implementations as mine are derived from looking at shader assembly. Clearing can be done with a single call, which is a win on any platform that clears by just setting a flag, where the time is dominated by jumping back and forth between the driver and user code, etc. Less of a win for platforms that modify each pixel, but still a slight win. Filling requires no render-target swaps. Filtering becomes a win because you can easily use any shadow filtering you wish. As mentioned by JoeJ, you widen the projection for each cube face by a specified amount of pixels, so for example if you have a 512×512 texture and you want to widen the projection by exactly 3 pixels, your field-of-view will be 90.33473583181500191937274374069° instead of 90°. Now you have 3 border pixels to sample for any kind of filtering you wish to use with no complicated math to sample across faces etc. This also allows all of your shadows to have a unified look, as you will no longer have to use one filter for spot lights and a simpler one for point lights. L. Spiro
  5. Shadow Mapping

    Because, as mentioned, scenes can vary widely, the common way to decide how many shadows you will have is derived from a performance goal on a specific target spec. In other words, determine how many shadows you can have while maintaining X FPS on Y hardware. The reason you should be using an algorithm like this to determine your own metrics is because not only do different scenes in different games come with different performance compromises, your own implementation of shadows may perform very differently from others'. Your question is useful for allowing you to consider how optimized shadow maps must be in other games and for you to consider how much you have to do to get there, but if you were asked right now by a boss to estimate how many shadows you can use you would use the above-mentioned process. To give you actual stats and an idea of the optimizations used, here is what I did on Final Fantasy XV. We had a basic implementation likely matching what you have, with cube textures for point lights and different textures for the rest (4 textures for a cascaded directional light and X spot lights). The first thing I did was improve the culling on the cascaded directional light so that the same objects from the nearest cascade were not being needlessly drawn into the farther cascades. If you aren't doing this, it can lead to huge savings as you can avoid having your main detailed characters being redrawn, complete with re-skinning etc. Next I moved the 6 faces of a cube texture to a single 1X-by-6X texture. So a 512-by-512 cube texture became a single 512-by-3,072 texture. Although you must write your own look-up function that takes 3D coordinates and translates them to a 2D coordinate on this texture, it comes with a few advantages in caching, filtering, clearing, filling, and most importantly it prepares for the next big optimization: a shadow atlas. Now that all shadows were being drawn to 2D textures, I created a texture atlas for all the shadows except the cascaded ones. A single large texture for all the point and spot lights. It was 2,048-by-2,048 first but could grow to 4,096-by-2,048 if necessary. Putting at the point and spot shadows into a single texture was a huge gain for many reasons, but one of main gains was that we had access to all the shadows during a single lighting pass, which meant we could draw all the shadows in a single pass instead of many. At this point our limit was simply how many shadows could be drawn until the texture atlas got filled, sorted by priority largely based on distance. As mentioned by MJP, an important aspect of this is to cull all six faces of a point-light shadow. Any shadow frustums not in view meant less time creating shadow maps and more room for other shadows in the atlas. Next, I wanted the shadow maps to have LOD, as the smaller shadow sizes would allow faster creation, and smaller shadow maps meant more shadows could fit into the atlas. Each shadow frustum (up to 6 for point lights and 1 for each spot light, where each shadow frustum at least partially intersects the camera frustum—any shadow frustums fully outside the view frustum would be discarded prior to this step) was projected onto a small in-memory representation of a screen and clipped by the virtual screen edges. This sounds complicated but it is really simple. The camera's world-view matrix translates points into a [-1,-1]...[1,1] space on your screen, so we simply used that same matrix to transform the shadow frustum points, then clipped anything beyond -1 and 1 in both directions. Now with the outline of the clipped shadow frustum in -1...1 space, taking the area of the created shape gives you double the percentage of the screen it covers (represented as 0=0% to 2=100%). In short, we measured how much each shadow frustum is in view of the camera. Based on this percentage, I would drop the shadow resolution by half, or half again if even less was in view, etc. I believe I put a limit at 64-by-64. If you play Final Fantasy XV, you can see this in action if you know where to look. If you slowly move so that a shadow from a point light takes less and less screen space you might be able to see the resolution drop. Now with the shadow-map LOD system, most shadows are drawn at a lower resolution, only going full-size when you get near and are looking directly at the shadowed area. Because this actually affects so many shadows, the savings are significant. If you decide to keep the same limit on shadows as you had before you will find a huge gain in performance. In our case, we continued allowing the shadow atlas to be filled, so we were able to support double or more shadows with the same performance. Another important optimization is to render static objects to offline shadow maps. A tool generates the shadow maps offline, rendering only static objects (buildings, lamp posts, etc.) into them. At run-time, you create the final shadow map by copying the static shadow map over it and then rendering your dynamic objects (characters, foliage, etc.) into it. This is a major performance improvement again. We already had this for Final Fantasy XV, but since I added the shadow LOD system I had to make the offline static shadows carry mipmaps. It is important to note that the shadow mipmaps are not a downsampling of mip level 0—you have to re-render the scene into each mipmap, again with some lower limit such as 64-by-64. All of this together allowed us probably around 30 shadow maps with the ability to dynamically scale with the scene and without too many restrictions on the artists. Shadow maps were sorted by a priority system so that by the time the shadow atlas was filled, the shadows that had to be culled were distant, off-to-the-side, or otherwise unimportant. L. Spiro
  6. Mod for Mac

    You would already have had an answer had you simply downloaded it and checked. L. Spiro
  7. I'm starting as an indie ! Any advices ?

    What is a "graphist"? An artist? You can advertise at literally any stage in development as long as your methods are in line with how much you have to show. Don't hype it up and then only show a concept and a sketch of a map. If you have very little to show, a simple blog post is appropriate. Once you have more, you can advertise it more aggressively. If you want to advertise it across several forums and sites, at the very minimum you must have something playable on your side. That doesn't mean you have to let people play, it means that you have a working prototype or game from which you can take enough screenshots to warrant people's time. I would generally say common sense should guide you. Don't pester people unless it is worth their time. That means that at this time, with what you have, it is definitely not okay to pester people with requests to "share if you find it interesting." L. Spiro
  8. How do you balance gaming and game dev?

    Won't stop me from trying. They are both hit-and-miss in different ways. Frequently indie studios are created by people who don't want to be told what to do—they have their own ideas and this is how to get them done. A "miss" here comes about when the designer doesn't have enough of a clue to know that he is doesn't stand out from anyone else in the industry. The quality of the game may suffer from lack of detail, poor controls, poor concept, etc. A "hit" here comes when you actually have someone with a genuinely good idea, who understands difficulty balance, progression, attention to detail, etc. The game usually ends up being something entirely new. In AAA development, a "miss" comes about because the designers and up are concerned about their jobs and profits, so once a winning formula is found they tend to stick to it. You get sequel-after-sequel and games with only slight deviations from the formula. Breaking from the formula is risky, so a "hit" here often means that the concept may not be radically new, but it's executed well, has sturdy tech and graphics behind it, good balance, etc. L. Spiro
  9. Your first project

    Same view on a different day: Maybe you can understand certain Japanese games' backgrounds better. Living in Tokyo gives you all kinds of ideas for games. This is the atmosphere behind my manga. The industry doesn't have to be hell. In fact there is a very simple algorithm that ensures you never get caught in hell no matter what your industry is: While ( JobIsHell ) GetNewJob();. It's so simple even a child could manage it. L. Spiro
  10. Hobby: How do you finish your projects?

    If you don't want to finish it, don't. Finishing things gives you the reward of being able to say, "I finished it." This may be useful if you are trying to put together a portfolio, but if you are bored with the project then you have to consider how much value that is compared to freeing your mind to work on something else. If I am bored with a project, then I consider "I finished it" to be +10 but "I am so fricking bored forcing myself to work on this when I want to do something else" to be -20 or less. No need to do something you don't want to do just because people artificially weighed the value of a completed project as higher than it really is. But if you want to avoid this in the future, pick projects that not only are very interesting to you, but that can give you a feeling of completeness before it is ever actually complete. Pick projects that give you rewards at many points during their development cycles. For example, I am the author of MHS (Memory Hacking Software), the primary competitor for CheatEngine. While working on it, I advertised about it on the typical cheat sites and gathered a following and put up forums so that people could talk about it, discuss improvements, etc. Now with a community based around it, each new release was its own reward for me. For each new feature I added, I got to watch the community reaction, which motivated me to keep working on the next new feature, and the cycle repeats. The ability to watch the community use my tool and keep up a cycle of interactivity with them fueled me for over 7 years on that one project. Pick a project that rewards you in steps along the way. If all you are doing is working in a black box with no reward until it is all finished, it is really hard to stay motivated. L. Spiro
  11. Your first project

    That is not my issue. My career in the industry has taken me around the world and has been very fun, allowing me to live a life of complete satisfaction, allowing me to see and do things that most people never will. Some days were stressful, but then I would look out the window from my office and see something like this: 20th-floor view from Square Enix My issue is that I am not just a programmer, and I have never been able to do just one thing. While in Japan I was able to do acting as well as program, but I still have to do art and music. In order to make time for a career in art and I will need to drop programming. The industry has been fine for me, but I want to move on to more creative careers. I had never planned on programming being my life-long career in the first place. L. Spiro
  12. Your first project

    After being in the industry for 14 years I am finally starting to move away from it. I am working on a manga, considering becoming a cartoon animator, and even considering career options involving working with animals. You can see some of the work on "Something Something 7 Online" here: http://www.memoryhacking.com/SS7O/index.html L. Spiro
  13. Your first project

    Super Mario World, Chrono Trigger, and Final Fantasy VII cemented my idea to become a video-game developer. I created many stages and designs but at around 13 I realized that if any of my designs were going to be made real then I would have to learn to program. My first project was a text-based guess-the-number “game” in which you entered a number and were told if it matched the number the computer randomly generated. If not, it would cuss at you. My first “real” project was an online clone of Final Fantasy VII which had 129 players during the short time I kept it online. L. Spiro
  14. That did it. Don’t know why that was not part of the original code, but thank you. L. Spiro
  15. I haven’t touched Windows development since Windows Vista, and I have only worked with the Win32 API (not MFC or etc.) I got a project from online that was made for Visual Studio 2015 and up to Windows 8.1, but I see no reason I should not be able to compile it with Visual Studio 2017 (I am running Windows 10 but I don’t think it was re-targeted towards Windows 10 during the project upgrade). But it gives me this error: using Microsoft::WRL::ComPtr; // Error C2653 'Microsoft': is not a class or namespace name Obviously searching for what I need to #include to get a namespace called “Microsoft” is useless—the returns are just MSDN articles explaining what namespaces are as it is not clever enough to realize I am telling it that the namespace is named Microsoft. So clearly I am missing some #include but this is a bit baffling as the project should just work. My research shows this is part of a “Universal” framework. I’ve spent the last 4 hours adding all the optional components to Visual Studio 2017 that could possibly be related and nothing fixes it. What the hell is this, what is the missing #include, and what the hell components do I need in Visual Studio 2017? L. Spiro