25,932 reputation
34483
bio website reedbeta.com
location Milpitas, CA
age 28
visits member for 2 years, 10 months
seen 15 hours ago

I'm a graphics programmer, an amateur physicist, and a sci-fi nerd. I teach computers how to make pretty pictures. I'm excited by beautiful, immersive, story-driven games and interactive fiction. I enjoy messing around with esoteric ideas. I like explaining things.

I currently work for NVIDIA DevTech. Previously, I worked for Sucker Punch Productions on the Infamous series of games for PS3 and PS4.

reedbeta.com - developer blog, OpenGL demos, and other projects. @reedbeta on Twitter.


Jul
24
comment OpenGL render to texture causing edge artifacts
That's very odd that changing the color buffer format would have that result. After all the screen is not a 32F buffer, but you could render to the screen without those artifacts. Using a 32F buffer will also hurt performance if you are rendering a lot to it (though it might not matter for you now).
Jul
22
comment D3D11 shader signature validation with SV semantics
D3D11 does have error checking. You just have to turn on the debug layer—then it will complain loudly about any mismatches of shader signatures. Also, is the instance ID not just D3D_NAME_INSTANCE_ID? As for ordering, AFAIK the order of outputs and inputs has to match, so any new SV inputs in a shader stage would indeed have to come at the end of the list.
Jul
16
comment Fast fullscreen quad rendering in Direct3D 11?
It sounds like you're memory-bandwidth-limited. Taking the bandwidth to be 25.6 GB/sec for the HD 4000 (from here), and 1366x768x16 bytes, I get 0.66 ms needed just to write all the data. If you are both sampling a texture and writing one, we can assume the required bandwidth is doubled, and switching to R11G11B10 would halve it. So this seems to line up nicely with your results. (BTW, the benefit of the thinner format is simply that there's less data overall, nothing to do with caching or simplifying arithmetic.)
Jul
14
comment How are 2D transformation matrices applied to their targets?
@user2533993 Well, simple blitting is what I was thinking of when I said "doesn't use 3D graphics hardware". The blitting could be done by the engine itself, by an OS API, or by 2D graphics acceleration; it doesn't really matter. The point is that the matrices are used to calculate the on-screen position at which to blit the sprite.
Jul
10
comment Geometry Shader input vertices order
In which order do the vertex/index buffer specify the vertices? The GS most likely receives them in that same order. So if the order is wrong in the vertex/index buffer it would be wrong in the GS as well. (Assuming that tessellation is not being used.)
Jul
9
comment Irradiance cubemap to spherical harmonics conversion
You can convert a cubemap to SH by calculating the integral of the cubemap * the SH basis function, for each SH coefficient. In other words, a sum over all the pixels in the cubemap, weighted by solid angle and the SH basis function.
Jul
7
comment what happens with missing vertices in geometry shader
@TimSeguine Right, the output would be triangle or triangle strip (it has to be triangle strip in D3D, not sure if the rule is different in GL). The GS is executed once per input primitive, yes. As for meshes with borders, how you handle that in the vertex data is up to you - you could make one of the adjacent triangles degenerate by repeating a vertex, for instance, or use a single "dummy" vertex per mesh to stand in for missing data. But the vertex data format itself does not have the flexibility to directly represent triangles with only partial adjacency.
Jul
6
comment D3D11 Can only Pixel Shader and Compute Shader stages write to buffers?
No, D3D11.1 is only available in Windows 8 and up. (Although the equivalent OpenGL functionality, image load/store and SSBOs, are available on any OS that supports OpenGL.)
Jul
5
comment Shadow Map field-of-view
@user48448 Did you update the viewport to match the size of the texture?
Jul
5
comment Closest distance from 3D point to vector line
A quick Google search gives tons of results for this.
Jul
5
comment D3D11 Can only Pixel Shader and Compute Shader stages write to buffers?
Starting in D3D11.1 (Windows 8) you can also write to UAVs from every pipeline stage.
Jul
4
comment Direct3d Techniques and Windows 8
In case it wasn't clear from Chuck's answer, this syntax belongs to the old-and-somewhat-deprecated "effect" system, which allowed wrapping up multiple shaders and render states in one source file using the technique/pass structure, and also provided a runtime API wrapping constant buffers and state-setting. D3D has moved away from this model; it now only officially supports one shader per file, and you must set up all constant buffers and state objects yourself.
Jul
2
comment Does allocating and freeing a huge chunk of memory at startup “clean up memory”?
The heap data structure that malloc uses isn't part of the OS; it's part of the C runtime library, and each application has its own separate heap (or more than one) in its own virtual address space. At app startup the heap will naturally be in an almost pristine state. The OS-level memory management is entirely separate - it might use heaps as well, but it operates on the level of whole virtual memory pages, not individual app-level allocations, and ought to be much more robust to fragmentation issues.
Jul
2
comment Does allocating and freeing a huge chunk of memory at startup “clean up memory”?
@CaptainCodeman Yeah, sequential DRAM access is faster, but we're talking about the virtual->physical mapping which happens in pages of 4 KB (or more), so whether that mapping is sequential or not shouldn't have much impact on memory read speeds. Plus, cache prefetching and stuff like that operates in virtual address space, not physical.
Jul
1
comment How would I warp a mesh with code?
So, you want to turn the model's head in different directions depending on user input? Are you familiar with skeletal animation? Sounds like you could just set the neck joint to the desired rotation and you'd be done. (Or if you have multiple neck joints, distribute the rotation amongst them for a more natural-looking result.)
Jun
28
comment Prewarming in particle engines
BTW, just as a simplification, timeUnit is equal to 1.0 / (FPS * this.rate), since the factors of this.life cancel out.
Jun
28
comment Is it more efficient to use an A* algorithm or a line system drawn in pathfinding in C#?
I can't see the picture but assuming you're talking about a system of waypoints and connections throughout the map, that works with A*; it's not an alternative to it. The waypoints and connections provide the graph that you do A* on. (You can also do A* on a grid, if you don't have a graph of waypoints.)
Jun
26
comment Is DXUT deprecated?
@Pierre For simple developer UI I've been using AntTweakBar lately as a DXUT replacement and I'm quite happy with it.
Jun
25
comment Why are god objects so common in game programming?
Why is this acceptable? Because it works well enough in practice. OOP design principles are ideals. Even if you accept OOP principles as appropriate ideals for a game engine—which not everyone does—they have to be balanced against real-world productivity, which can be hurt by spending too much time chasing after a design ideal.
Jun
24
comment How to send multiple MVP matrices to a vertex shader in OpenGL ES 2.0
@Winged Ah, I don't know if this is possible in WebGL. In vanilla OpenGL you'd pass a whole array of matrices by using the count parameter, as you mentioned.