Reputation
1,823
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
4 9
Newest
 Yearling
Impact
~30k people reached

  • 0 posts edited
  • 1 helpful flag
  • 79 votes cast
1d
comment How do I prevent raycast car wheels sliding sideways?
Yeah, I didn't really think that was going to give you the answer you needed, but it was much too long to put in a comment ;)
1d
comment SSAO, depth buffer linearization (?)
As a matter of fact, you might want to check out an answer I wrote on Stack Overflow using that code. I don't see anything horrifically wrong with your code, but I know that my own code for linearizing depth and reconstructing position actually works ;)
1d
comment SSAO, depth buffer linearization (?)
Given window-space depth (the depth you sampled from your depth texture) [0.0,1.0], linearizing it should be as simple as return n / (f - z * (f - n)) * f;
Aug
28
answered How do I prevent raycast car wheels sliding sideways?
Aug
28
comment Whats the best program to make a 16-Bit game?
MS-DOS used to be the defacto standard for 16-bit games. But you probably don't want to deal with segmented memory and all that fun stuff. Consider making a 32-bit game :P
Aug
25
comment How to wrap textures inside shader GLSL
Oh wow, I have never seen anything like that before. I really don't know what that is. That's not at all what I was discussing. There might be a floating-point error somewhere, you should try outputting the texture coordinates in your GLSL fragment shader to see if they behave sensibly (they should be a smooth red-green gradient). While you're at it, it might help if you added your vertex and fragment shaders to the question so I can see what you have tried.
Aug
25
comment How to wrap textures inside shader GLSL
Oh, really? Can you link to a screenshot illustrating your problem? Those artifacts almost certainly come from linear texture filtering, when you use linear filtering you have to be extremely careful with coordinates at the edges, especially if the texture is a spritesheet / atlas.
Aug
24
awarded  Yearling
Aug
24
comment How to wrap textures inside shader GLSL
fract (tex_coord.st) will do the same thing, this is not particularly useful knowledge but I thought you might like to know ;)
Aug
21
comment OpenGL strange lighting/model problem
Also, does your view matrix contain scaling? I think you may need to transform your normals a little bit differently, but I can't tell without your vertex shader code or how the view matrix is computed.
Aug
21
comment OpenGL strange lighting/model problem
Are you aware that VAOs track the currently bound IBO? Something funny may happen due to the order you unbind VAO and IBO. The VAO retains the IBO you bound several lines prior, then after you unbind the VAO you unbind an IBO from the global scope (not relative to any VAO). I doubt this is your problem, but you shouldn't be doing it in that order. Frankly because VAOs track IBO, you can probably get away with binding the IBO one time when you setup your vertex pointers and never touching that state again.
Aug
20
comment How to debug a DirectX crash on client machine?
Investigate the code around your swap-chain presentation. That's how those overlays work, they inject some code every time you swap buffers.
Aug
19
comment Open GL: How to map point inside frustrum to normal device coordinates (NDC)?
The bottom row is necessary to flip the z-axis between view-space and clip-space. This is illustrated in the following diagram. See how Z points in a different direction pre- and post-projection? Everything else about that diagram is wrong though =P That's Direct3D's NDC and screen-space convention.
Aug
19
comment Strange SSAO effect (wrong position/normal textures in view space?)
That is all good, actually. The code completely takes care of this for you right now. The normals are stored in the range 0.0 - 1.0 in the texture, but rescaled to -1.0 - 1.0 after sampled; your position is also. However, the 1 - depth part looks odd to me. I think it should be depth - 1, otherwise your depth range is inverted.
Aug
19
comment Strange SSAO effect (wrong position/normal textures in view space?)
No, you can't store negative values in DXGI_FORMAT_R8G8B8A8_UNORM. You would need the SNORM version of that, or half of your vector space will be clamped to 0. I actually see now that this is taken care of already by multiplying by 2 and subtracting negative 1 in both the normal and position code. However, I strongly suggest that before outputting these colors to screen for visualization, you make a habit of doing * 0.5 + 0.5 (so you can see the negative parts of your coordinate space). As for 0.5 + 1.0 that would not work, your colors would go 0.5 to 1.5 (clamped to 1).
Aug
18
comment Strange SSAO effect (wrong position/normal textures in view space?)
Stupid question: are your render targets floating-point? The screenshots you've shown with coordinate spaces in them have big black spaces where all three coordinates are 0 or negative. They're all clamped to 0 using traditional fixed-point (UNORM) render targets and you definitely won't get accurate SSAO when you can't sample the position/normal correctly. You don't technically need floating-point render targets if you're concerned with performance - you can use SNORM or rescale/offset the colors manually.
Aug
17
comment Problem passing variables in fragment shader
@mgoetschius: Ah, gotcha. The thing is, that's a const-index-expression It's not dynamic at all, the compiler could easily unroll this because the number of iterations is known at compile-time.
Aug
16
answered Problem passing variables in fragment shader
Aug
16
answered Stencil buffer VS conditional discard in fragment shader
Aug
16
comment Varying framerate (FPS)
It's of course no longer a fixed timestep, but that's not necessarily a bad thing if your framerate is crazy variable and you don't want to set a constant timestep very low.