Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

1700 Excellent

About ATEFred

  • Rank

Personal Information

  • Interests
  1. ATEFred

    Deferred texturing

    This will not help with your performance issues. Sub pixel triangles (even sub quad triangles) are going to hurt you, and your pre-pass won't be a fast depth only pass either. What you describe though sounds very close to Oxide's Image Based Lighting. They effectively build up UV unwrapped Gbuffers for their different meshes (offline), then at runtime do the lighting and shading in image space (uv unwrap space), and then the actual scene rasterization happens at the end with in theory the most simple of shaders. It allows decoupling the resolution of rendering (rasterization pass) from the lighting/shading resolution. You could also update the shading at a lower frequency, but you might then get issues with view dependent effects like reflections / specular.
  2. ATEFred

    Deferred Decal Skinned Meshes

    There are many options: you can generate the decal geometry in a GS, or on CPU, or you could render out the decal in texture space for your skinned mesh and apply it straight on the model depending on how your UVs are setup, etc. 
  3. the best technique is highly dependent on your exact requirements. i.e. scene type, scale, amount of dynamic objects, lighting complexity, how many bounces you want, how many months or years you want to spend researching this, what your target HW is, etc. I think it is safe to say no GI technique is trivial to implement in a way that looks good in real life scenarios and runs fast (no light leaking, bugs, etc.) It's an area of active research, so you won't find ready made solutions. Maybe it's best just to start by implementing some of the building blocks techniques, like basic RSM or lightmap baking, and taking it from there. If you want to read up on modern approaches for dynamic GI, Remedy just released a paper going over their approach. Not miles apart is Ubi's solution used on Far Cry 3/4. Another trendy approach I have not seen used in commercial larger games yet is Voxel Cone Tracing. Google will lead you to a bunch of papers for all of these, but realistically this is not the type of thing where you just follow the paper and will get awesome results fast.
  4. I use collada (dae) format models, I then wrote a converter that uses Assimp to read the data in and spit out my own optimized format. Collada is kind of a bloated format but I don't use the daes at runtime so it doesn't matter. Most people I know now use FBX, but I have not tried that so I can't comment on it.
  5. ATEFred

    Terrain tesselation and collision

    In some cases you might not be able to get the same level of detail on your physics terrain and tessellated terrain mesh (for reasons xyz). On one project I worked on some clever guys at NV came up with an approach which would evaluate height of the ground on GPU at the positions of the various character bones, and then offset the bones if needed, to make sure that there was no issues with the characters sinking into the ground. Overall it worked really well. (technically not correct since you would have cases were one leg would be shorter than the other for example, but not very noticeable in game)
  6. ATEFred

    Inner edge detecting

    I heard of it. I will try to get hang of the theory explained in your provided link.   That was just the first link I found on google. It's pretty simple in practice: sample your depth buffer for the point your are shading and the surrounding points, compute how much variance there is over the kernel, and this will tell you if you are on/close to an edge or not. You can then shade the point differently based on that. Kernel size will impact how wide your filter is. (though you can control the thickness in other, more performance friendly ways as well of course)
  7. ATEFred

    Inner edge detecting

    A pretty effective and simple way can be analysing your depth buffer. Using a sobel filter is pretty common for that kind of operation. http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobel.htm
  8. If you are referring to stepping through shader code, this is no longer the case. You can now do everything on one single (nv) gpu machine.  I think NSight is way superior to the vis graphics debugger. If you have an NV gpu, it is really worth it. It also works with OGL if that is of any use to you.  
  9. ATEFred

    glDrawElements invalid operation

    Latest version of NV Nsight also supports ogl 4.x ( 4.2/4.3? can't remember exactly ). Was really helpful figuring these kind of errors out ( gl event list with highlighting for the dodgy calls ). Highly recommended if you have the required hardware.
  10. It does depend heavily on HW. ATI gave a presentation at gdc this year that showed that on their hw using the GS was somewhat slower than calling DrawInstanced with 4 verts per quad and doing the work in the VS instead, whereas on recent NV hw it was pretty much the same.
  11. ATEFred

    Kinds of deferred rendering

    You don't need position, you can reconstruct it from the depth and pixel positions when you need it. (allows you to not require 32bit per channel additional RT in your gbuffer). other than that, you have a good starting point. Normals, material properties like spec power, spec factor / roughness, albedo colour and depth of course.   gamma correction only really makes sense if you support HDR (or you would get quite bandy results I think). The idea is to get your colour texture samples and colour constants in linear space (either doing the conversion manually or using the api / hw for textures and rendertargets at least). then do lighting, then hdr resolve and conversion back into gamma space. 
  12. ATEFred

    Kinds of deferred rendering

    There are commercial game engines that use all of these approaches. Frostbite 3 uses the tiled CS approach, the Stalker engine was the first to use the deferred shading approach that I know of, loads of games have used light prepass ( especially 360 games to get around edram size limitations / avoid tiling ), Volition came up with and used inferred in their engine, forward+ seems to be one of the trendier approaches for future games, not sure if anything released uses that already. The main thing is for you to decide what your target platforms are and what kind of scenes you want to render. (visible entity counts, light counts, light types, whether a single lighting model is enough for all your surfaces, etc.)  For learning purposes though, they are all similar enough that you can just pick a simpler one (deferred shading or light prepass maybe), get it working, and then adapt afterwards to a more complex approach if needed.  As for docs / presentations, there are plenty around for all of these. I would recommend reading the GPU pro books, there are plenty papers on this. Dice.se has presentations on their website you can freely access for the tiled approach they used on bf3. GDC vault is also a great place to look. You can also find example implementations around, like here: https://hieroglyph3.codeplex.com/ (authors are active one this forum btw)
  13. ATEFred

    Kinds of deferred rendering

    The best way will depend on the type of scene you have and your target hw. They are mostly pretty similar, but here is an overview of a few of the popular ones: - deferred shading, based on generating a gbuffer for opaque objects with all properties needed for both lighting and shading, followed by light pass typically done by rendering geometrical volumes or quad for each light and a fullscreen pass for sunlight, followed by composite pass where lighting and surface properties are combined to get back the final shaded buffer. This is followed by alpha passes, often with forward lighting, and post fx passes, which can use the content of the gbuffer if needed. Full or partial Z prepass is optional. Advantages include potentially rendering your scene only once and  - light prepass/ deferred lighting involves the same kind of steps, only with a minimal gbuffer containing only what you need for the actual lighting ( often just depth buffer + one render target containing normals + spec power ), the same kind of light pass, but then another full scene rendering pass to get the final colour buffer. This means loads more draw calls, but much lighter gbuffers, which can be handy on HW with limited bandwidth, limited support for MRTs, or limited EDRam like the 360. Also gives more flexibility than the previous approach when it comes to object materials, since you are not limited to the information you can store in the gbuffer. - inferred rendering, which is like light prepass, only with a downsampled gbuffer containing material IDs, downsample light pass, but high res colour pass which uses IDs to pick the correct values from the light buffer without edge artifacts. Kind of neat way of doing gbuffer and light pass much faster at the cost of resolution. Can also be used to store the alpha object properties in the gbuffer with a dithered pattern, and then excluding the samples you don't want / not for that layer during the colour pass. So no more need for forward lighting for alpha objects (up to a point). - tiled deferred involves not rendering volumes or quads for your lights, which can be pretty extensive when you get alot of light overdraw, especially if your light volumes are not super tight, but instead divide your screen into smaller tiles, generate a frustum per tile, cull your lights on gpu for each tile frustum, and then light only the fragments in the tile by the final list. Usually done in CS, no overdraw issues at all, overall much faster, but requires modern HW and also can generate very large tile frustums when you have large depth discontinuities per tile. The last part can be mitigated by adding a depth division to your tiles ( use 3d clusters instead of 2d tiles ). - forward+ is similar, but involves z prepass instead of gbuffer generation, then  pass to generate light lists per tile, same as above, but instead of lighting at that point, you render your scene again and light forward style using the list of lights intersecting the current tile. Allows for material flexibility and easy MSAA support at the cost of another full geo pass. There are loads more variations of course, but these are maybe a good starting point.
  14. ATEFred

    Light rays through windows

    Yeah, these look like billboards. Other than billboards which are somewhat limited, and the screen space approach agleed mentioned, you can do the following: a screen space pass where for each pixel you march through your shadowmap(s). So for each pixel cast a ray which you march along for N steps, get light space position for the step world or screen space position, and do a shadow map check. This tells you if that point of your atmosphere is lit or not, accumulate and job done. You can do this at lower resolution with some depth aware upscaling if you want for performance. Downside is you can get banding if you don't do enough steps (and more steps equals bigger perf cost). NV where talking about doing some kind of mesh extrusion for this using the tessellation stages at gdc this year, but I haven't looked into that approach. I think the slides are publicly available on the gdc vault.
  15. One approach is have attractors on the start and end of your trace creating object ( such as the hilt and tip of a sword ), and create bands of geometry every frame from these attractor positions. Simplest form of that is one band being 2 verts, one for each attractor / end of the band, have a dynamic vertex buffer which you fill up with all active band vertices, from newest to oldest ( or the other way around ). You can use vertex colours for fading it out. Then render it as a tri strip, and job done :)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!