I have been working with Cubic and Quadratic bezier curves for the past week, and one thing that I am still not sure about is how to get the polynomial coefficients from the control points. For example, a cubic bezier has the formula A*t^3 + B*t^2 + C*t + D and a quadratic one has A*t^2 + B*t + C. The cubic bezier is defined by the end points P0 and P3, and the control points P1 and P2. The quadratic one is just P0, P1 and P2. http://floris.briolas.nl/floris/2009/10/bounding-box-of-cubic-bezier/ says that the coefficients for the cubic bezier can be calculated like:
These coefficients can be plugged into the formula A*t^3 + B*t^2 + C*t + D and it works, so they seem to be okay. I am not sure how those coefficients were derived though. Can anyone explain this to me? Also, I would need to calculate the same coefficients for a quadratic bezier.
I have always worked with vertex shaders that have taken some vertex format as input. What am I supposed to set as input layout (ie. with IASetInputLayout()) before drawing using FXAA? Also I am pretty sure I am supposed to draw a fullscreen quad when using this, but I though I would check with you just in case I am not. And, if I am indeed supposed to draw a fullscreen quad, should the VS not transform the coordinates, or at least pass them on to the next stage in the pipeline?
Using the new VS2012 graphical debugger it is very easy to take a snapshot of a frame (eg. by pressing Print Screen), and getting the contents of the back buffer into the debugger where you can inspect the pixel history etc. However, I have several offscreen buffers the content of which I would like to inspect in the same way. My engine renders the scene something like:
1. Render all shadow maps
2. Render the view space normals and depth to a buffer for SSAO use
3. Calculate the SSAO
4. Render the main scene.
What if I wanted to inspect one of the shadow maps or the SSAO normal/depth map? How do I get those buffers into the debugger?
I have cascaded shadow maps setup and working pretty well in my engine. I have large outdoor scenes and currently only one light (the sun) casting shadows. The problem is that when objects are high up, eg. right above the camera, it is outside the closest, highest detail cascade, and thus does not cast any shadows. My camera usually looks a bit down, since it's a third-person game I am making. How should I go about fixing this? Should I just make the cascades big enough to contain all objects in the scene? This, of course, would mean that the resolution of the cascades goes down.
The high-up objects are mostly static. Should I look into doing some sort of offline precalculated shadow data for these objects?
I am working on a game with large outdoor terrains, and I have a heightmap-based terrain system set up. The heightmaps are generally quite detailed, eg 2049x2049 (for 2048x2048 quads), and I do dynamic LOD on the GPU. However, for the physics this detail is not always a good idea. My players (vehicles) get stuck on small bumps etc. and the terrain physics are quite heavy. This is why I would like to scale down the original heightmap to something like half the resolution, or a fourth of the resolution or whatever the level in question works best with, and use this lower detail heightmap for the physics mesh.
What algorithm should I use for something like this? I should be fast enough so that I can run it when the level loads, and generally "work well" for terrain physics meshes. Do I just calculate the average over the nearby vertices or is there some better way to do it?