• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

PixelSmasher

Members
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

445 Neutral

About PixelSmasher

  • Rank
    Member

Personal Information

  • Location
    France
  1. So ? Is your problem solved or do you have no hair left debugging ? ^^
  2. In your vertex shader, you are computing the vertex normal with frag_normal = normalize(WorldMatrix * vec4(vert_normal, 1.0)); In homogenous coordinates, the last "w" scalar value set to 1.0 means that vert_normal is a point. As it is a mere unpositioned vector, i think using 0.0 should fix your bug.     Moreover, normalizing the interpolation variable frag_normal (set as "smooth out" and "smooth in" by default) will lead to incorrect normal vectors as they won't stay normed during their interpolation across vertices. You should normalize it in the fragment shader.
  3. A blocky mess ? As no filtering is applied, it looks perfectly fine - and shitty - to me. You should add some bias to prevent banding on curved meshes though. You are facing a nasty math-related bug and it always means having a bad time eradicating it.   Try outputting all the values you can to empirically find out what the issue is and be amazed when you discover it was so simple :) (I'd really like to see the values of the variable "fracs" !)   Another trick that could work : use (ShadowMapSize + float2(1, 1)), it helped me in some situations
  4. Clearly the issue comes from bad weights applied to your boolean coefficients. Try outputting the weight values and see if some artifacts appear.   That's the good old way of debugging your shaders ;p
  5. Sorry it was like I was talking to myself ^^   I've already encountered this problem while coding PCF, the problem was located in float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize);   I remember that the solution was something like: float2 fracs = frac(shadowTexCoord.xy * ShadowMapSize + float2(0.5, 0.5));   EDIT : or it could be something similar when you compute your offsets in: float2 offset = float2(x, y) * (1.0f / ShadowMapSize); Try: float2 offset = (float2(x, y) + float2(0.5, 0.5)) * (1.0f / ShadowMapSize);    
  6. Hmmm sounds like an half-pixel issue to me...
  7. Here's the code I'm using to integrate the SMAA in our engine shader generator. The #define [b]ENABLE_SMAA_VS[/b] is set only when compiling a vertex shader. The DX9 compiler was messing things up otherwise (as well as our GLSL converter). [CODE] // -- Pass 0 void VS_SmaaPass0( vs_Input _vs_In, out float4 f4_Position : POSITION, out float2 f2_TexCoord : TEXCOORD0, out float4 f4_Offset0 : TEXCOORD1, out float4 f4_Offset1 : TEXCOORD2, out float4 f4_Offset2 : TEXCOORD3 ) { ComputePosUV2D(f4_Position, f2_TexCoord, _vs_In.f4_Position, _vs_In.f2_TexCoord0.xy); // Store the vertex position & its texcoord in f4_Position and f2_TexCoord #if defined(ENABLE_SMAA_VS) float4 f4_Offsets[3]; SMAAEdgeDetectionVS(f4_Position, f4_Position, f2_TexCoord, f4_Offsets); f4_Offset0 = f4_Offsets[0]; f4_Offset1 = f4_Offsets[1]; f4_Offset2 = f4_Offsets[2]; #else f4_Offset0 = float4(0.0, 0.0, 0.0, 0.0); f4_Offset1 = float4(0.0, 0.0, 0.0, 0.0); f4_Offset2 = float4(0.0, 0.0, 0.0, 0.0); #endif } float4 PS_SmaaPass0( float2 f2_TexCoord : TEXCOORD0, float4 f4_Offset0 : TEXCOORD1, float4 f4_Offset1 : TEXCOORD2, float4 f4_Offset2 : TEXCOORD3 ) : COLOR0 { #if defined(ENABLE_SMAA_VS) return float4(0.0, 0.0, 0.0, 0.0); #else float4 f4_Offsets[3]; f4_Offsets[0] = f4_Offset0; f4_Offsets[1] = f4_Offset1; f4_Offsets[2] = f4_Offset2; return SMAALumaEdgeDetectionPS(f2_TexCoord, f4_Offsets, samp_SmaaSourceTex); #endif } // -- Pass 1 void VS_SmaaPass1( vs_Input _vs_In, out float4 f4_Position : POSITION, out float2 f2_TexCoord : TEXCOORD0, out float2 f2_PixCoord : TEXCOORD1, out float4 f4_Offset0 : TEXCOORD2, out float4 f4_Offset1 : TEXCOORD3, out float4 f4_Offset2 : TEXCOORD4 ) { ComputePosUV2D(f4_Position, f2_TexCoord, _vs_In.f4_Position, _vs_In.f2_TexCoord0.xy); #if defined(ENABLE_SMAA_VS) float4 f4_Offsets[3]; SMAABlendingWeightCalculationVS(f4_Position, f4_Position, f2_TexCoord, f2_PixCoord, f4_Offsets); f4_Offset0 = f4_Offsets[0]; f4_Offset1 = f4_Offsets[1]; f4_Offset2 = f4_Offsets[2]; #else f4_Offset0 = float4(0.0, 0.0, 0.0, 0.0); f4_Offset1 = float4(0.0, 0.0, 0.0, 0.0); f4_Offset2 = float4(0.0, 0.0, 0.0, 0.0); #endif } float4 PS_SmaaPass1(float2 f2_TexCoord : TEXCOORD0, float2 f2_PixCoord : TEXCOORD1, float4 f4_Offset0 : TEXCOORD2, float4 f4_Offset1 : TEXCOORD3, float4 f4_Offset2 : TEXCOORD4) : COLOR0 { #if defined(ENABLE_SMAA_VS) return float4(0.0, 0.0, 0.0, 0.0); #else float4 f4_Offsets[3]; f4_Offsets[0] = f4_Offset0; f4_Offsets[1] = f4_Offset1; f4_Offsets[2] = f4_Offset2; return SMAABlendingWeightCalculationPS(f2_TexCoord, f2_PixCoord, f4_Offsets, samp_SmaaSourceTex, samp_SmaaAreaTex, samp_SmaaSearchTex, 0); #endif } // -- Pass 2 void VS_SmaaPass2( vs_Input _vs_In, out float4 f4_Position : POSITION, out float2 f2_TexCoord : TEXCOORD0, out float4 f4_Offset0 : TEXCOORD1, out float4 f4_Offset1 : TEXCOORD2 ) { ComputePosUV2D(f4_Position, f2_TexCoord, _vs_In.f4_Position, _vs_In.f2_TexCoord0.xy); #if defined(ENABLE_SMAA_VS) float4 f4_Offsets[2]; SMAANeighborhoodBlendingVS(f4_Position, f4_Position, f2_TexCoord, f4_Offsets); f4_Offset0 = f4_Offsets[0]; f4_Offset1 = f4_Offsets[1]; #else f4_Offset0 = float4(0.0, 0.0, 0.0, 0.0); f4_Offset1 = float4(0.0, 0.0, 0.0, 0.0); #endif } float4 PS_SmaaPass2( float2 f2_TexCoord : TEXCOORD0, float4 f4_Offset0 : TEXCOORD1, float4 f4_Offset1 : TEXCOORD2 ) : COLOR0 { #if defined(ENABLE_SMAA_VS) return float4(0.0, 0.0, 0.0, 0.0); #else float4 f4_Offsets[2]; f4_Offsets[0] = f4_Offset0; f4_Offsets[1] = f4_Offset1; return SMAANeighborhoodBlendingPS(f2_TexCoord, f4_Offsets, samp_SmaaSourceTex, samp_SmaaBlendTex); #endif } [/CODE]
  8. Hi FriendlyFire. I'm sorry for the late answer, I'm in total crunch time and deadlines do not forgive ! I eventually got SMAA to work on console aaaannnnnd it took 10 ms to render ! This is the time I gave up. To have it working on PC, I simply turned the pixel shader interpolated array "offsets[3]" into 3 interpolated values "offset0", "offset1" and "offset2". The compiler did mess with them.
  9. A fast update during my epic and painful quest for SMAA : after a week of despair, I noticed the DX9 version of SMAA is working on a GTX560 Ti... How cool is that ? This code is actually working !!! Not that cool ! As I'm now into the depths of HLSL assembly, trying to find out what the compiler messed up [img]http://public.gamedev.net//public/style_emoticons/default/ph34r.png[/img].
  10. Unfortunately, I am not. This technique seems to remain unnoticed (or people consider that such artifacts are unworthy of their time [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]). There is this [url="http://www.youtube.com/watch?v=WnNOMTDmYTg"]video[/url], made by the author of Dual-Sphere Unfolding (It was my only help when implementing my demo), but nothing from the community. If you ever find something, I would be greatly interested.
  11. Hi FriendlyFire, I'm currently replacing FXAA with SMAA 2.7 in our engine and I'm stuck on the same problem: the result of the second pass is very similar to yours. Have you figured out what was wrong with your implementation ?
  12. I tried this method in a recent [url="https://vimeo.com/39475515"]project[/url] to fill a scene with 100 dynamic lights casting shadows. The theory is appealing and the results are not so bad... BUT you'll want to have a very fine geometry in order to obtain accurate shadows: the projection used to store the whole shadow sphere in a single texture will highly bend the geometric data, thus leading to frequent artifacts during the depth comparison. (Though I had to rush that project so I might have missed something) Still, it was tremendously fast and produced cool shadows... If you don't stare at them too much [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]
  13. Hi again and sorry for the late answer. After several optimizations, loop unrolling and code vectorization, I get awesome results with the same image produced in 2.36ms for a 720p resolution ![list] [*]AO computation pass : [b]1.5 ms[/b] [*]Horizontal bilateral blur : [b]0.43 ms[/b] [*]Vertical bilateral blur : [b]0.43 ms[/b] [/list] Hints : - The GL_AMD_texture_texture4 extension (allowing to quickly fetch 4 adjacent pixels) was available on the target console. Always use it (or fetch4 or textureGather or whatever with the same behaviour) and smile while looking at your perf counter. - Kill loops with fire ! They are horridly slow ! (Look at the code generated by your shader compiler to see if they were not unrolled at compil time)
  14. I get good results on PC (5 ms with an unoptimized version). On console, which is the release target, I get disastrous perf (8 ms on a 720p resolution), mainly due to a low texture cache. I'm currently working on aggressive optimizations and will update this post when I'll get a shippable implementation.