25,922 reputation
34483
bio website reedbeta.com
location Milpitas, CA
age 28
visits member for 2 years, 10 months
seen 7 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.


7h
comment Trying to find/create a shader for vertex coloring + vertex lighting without a diffuse texture
So...you're basically asking for someone to write you exactly the shader you need? Also, why can't you take the shader with the "extra lighting features" and just remove the parts you don't want?
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
13
answered How are 2D transformation matrices applied to their targets?
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
7
answered what happens with missing vertices in geometry shader
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
5
answered Shadow Map field-of-view
Jul
4
answered Find point in 3D plane
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
answered How to find the points of intersection of two rectangular OBBs