1,728 reputation
39
bio website nothing-inc.com
location Cape Coral, FL
age 30
visits member for 1 year, 7 months
seen yesterday

My interest in Computer Graphics dates back to AlphaWorld (1995), the first true 3D internet-based virtual world that allowed real-time collaborative construction. In 1998, I began to dabble in OpenGL and have since amassed an expert knowledge in OpenGL and Computer Graphics in general.

Outside of Computer Graphics, I spent a great deal of my academic career working with Real-Time Safety Critical Embedded Systems based on the VxWorks platform. My research has been published in a variety of fields including Machine Learning, Real-Time Operating Systems and Fault Tolerance.

   profile for Andon M. Coleman on Stack Exchange, a network of free, community-driven Q&A sites


Mar
23
comment Trouble with Raycast Selection using OpenGL
Is that red line supposed to be your ray? The result of gluUnProject (...) is in object-space, so it's perhaps not a good idea to try and draw it directly. You'd want to apply all the same transformations as you did to the rest of the scene (e.g. scaling and translation).
Mar
23
comment opengl : Running at least 25 windows with different Draw callback
Does this game need to be playable? That sounds like a recipe for disaster. If you enable VSYNC you'll basically only get 2 FPS in your application in the best case ;)
Mar
17
answered HLSL Pixel Shader for Depth Only Pass
Mar
17
comment HLSL Pixel Shader for Depth Only Pass
It does prevent early Z, which I pointed out in parentheses in my original comment. The thing is, a fixed-function alpha test also disables early Z. Any test that can only be performed after or during execution of a pixel/fragment shader disables early Z, and alpha testing (whether you implement it yourself or use some fixed-function feature) can only be done after color is computed per-pixel.
Mar
17
comment HLSL Pixel Shader for Depth Only Pass
Yes, that is absolutely where you would use discard (GLSL) or clip(-1) (HLSL). It tells the fragment/pixel shader to throw away the results for the current pixel; this includes color, depth, stencil. It is as though the pixel never existed. In fact, in modern OpenGL there is no fixed-function alpha test anymore, you actually have to implement alpha testing yourself using discard.
Mar
17
comment HLSL Pixel Shader for Depth Only Pass
I do not quite understand why you want to output an alpha value? You should be able to sample the texture and then clip (-1) directly from the pixel shader that writes depth for any alpha sample that fails; no color output necessary. You will make the shadow map generation perform slightly worse by doing this (it violates certain hardware optimizations to arbitrarily discard a pixel during the evaluation of a pixel shader), but it might not be all that bad considering how simple the pixel shader is.
Mar
15
comment How to assign texture to shader?
@davidvanbrink: There is one other possibility you can consider on newer GPUs. You can declare arrays of sampler2D uniforms in modern GLSL, and you could use a separate uniform to index this array to pick the relevant sampler at run-time. This is tremendously useful for instancing, and may help in your situation as well.
Mar
15
comment How to assign texture to shader?
@davidvanbrink: Well, the actual act of setting a uniform has virtually no overhead. Of all the states you can change, it is quite possibly the cheapest, there's no validation or anything like that (where as binding a texture has quite a bit of validation). An LRU replacement policy should work very well. I am at a loss as to why the first approach would actually be measurably slower, unless you are doing something silly like querying the uniform location by name each time you assign it a value.
Mar
15
answered How to assign texture to shader?
Mar
13
comment State Machine class vs function pointers
Bjarne Stroustrup would probably tell you something to the effect, "you are designing your system using C mentality ... that's not an effective use of the language." :P I actually agree in this situation, usually I find he pushes C++ language features a little bit excessively, but there is no reason not to embrace OOP and generic programming here when your language is C++. Templates and classes will improve code reuse and maintainability tremendously if you take the time to work with them.
Mar
13
comment Coordinate system in OGLdev tutorials
Your projection matrix is transposed for one thing. GLM uses column-major matrices and GL expects column-major matrices, but that matrix is clearly row-major. Also m34 (3rd column, 4th row) is typically -1 in a GL projection matrix. It does not have to be, but this operation is what causes the (traditional) right-handed view-space coordinate system to properly transform to left-handed after projection (clip-space). The deciding factor here is going to be your view matrix, which is not shown. Whether that traditional Z-axis negation is necessary or not depends on the view matrix.
Mar
10
comment How to use multiple custom vertex attributes in OpenGL
Why are you mixing and matching fixed-function vertex pointers with generic vertex attributes in the first place? That is allowed, though inadvisable, in compatibility profiles. On modern platforms that only offer core profiles, you need to ditch that altogether and use your own generic attribute numbering convention. For portability, plan to do that now rather than later.
Mar
10
answered Why encode floats in RGBA?
Mar
9
answered To what extent are video game bots & NPCs “artificial intelligence”?
Mar
9
comment Why encode floats in RGBA?
Floating-point texture formats were not always supported by D3D. On older hardware you have to encode the depth to a traditional 4 channel 8-bit unorm texture if you want 32-bit depth.
Mar
8
comment XNA/C# Shadows look strange in orthographic
Direct3D has clamp to border texture addressing as well. I'm not really keen on how to use it (how to set the texture's border color, that is), but I know it's there.
Mar
8
comment XNA/C# Shadows look strange in orthographic
@RyanEarnshaw: You take 4+ samples using point sampling, do 4 independent depth tests and then average the pass/fail result. The fundamental concept is known as Percentage Closer Filtering, instead of rounding hard edges, it softens them by providing shadows that don't 100% pass/fail. You can actually do this automatically if you use a texture lookup that includes comparison (e.g. SampleCmp).
Mar
7
answered Level loading philosophy in MMO games
Mar
7
comment How many directional lights in Unity
What kind of weird modern engine would impose a limit like that? Back in 2002 I was doing 6 per-pixel lights per-pass on Radeon 9700 hardware. With modern instruction limits and multi-pass rendering this all seems absurd to me.
Mar
7
comment XNA/C# Shadows look strange in orthographic
It's usually the other way around, you get blocky shadows with a perspective projection since precision distribution is biased based on distance. The only difference I see between those screenshots is that one of them is obviously incorrectly filtered. You appear to be linearly filtering the depth texture, which will round the edges of shadows. To properly filter shadows, you need to perform multiple depth tests instead of a single depth test using the average of multiple depths; sort of the opposite of regular texture filtering.