http://blog.selfshadow.com/publications/blending-in-detail/
- Viewing Profile: Reputation: AliasBinman
Community Stats
- Group Members
- Active Posts 26
- Profile Views 699
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
AliasBinman hasn't added any contacts yet.
#5060993 Blending Normal Maps
Posted by AliasBinman
on 10 May 2013 - 10:15 PM
#5057308 Lighten/Darken a color
Posted by AliasBinman
on 27 April 2013 - 01:27 PM
The simplest way is to do a lerp.
newcolor = lerp(color, vec3(1,1,1), x) to Lighten
newcolor = lerp(color, vec3(0,0,0), x) to Darken
In both cases x goes from 0 (no change) to 1 (full change)
if you don't know what a lerp is its a linear interpolate from 1 component to the next.
c = a + (b-a)*x
#5051881 Color correction - 3D LUT
Posted by AliasBinman
on 10 April 2013 - 12:07 PM
So if XY is RG and B is the chart index then do
UV.rg = (UV.rg * 15.0f/16.0f) + (0.5f/16.0f);
You may not need the (0.5f/16.0f) at the end depending on whether you need the half texel offset.
To filter across charts you'll need to do two taps and a lerp on the fractional distance between charts.
#5049806 Depth pre pass worth it ?
Posted by AliasBinman
on 03 April 2013 - 08:17 PM
If you have some memory to spare then its worth doing a position only VB and IB for each mesh. As well as this just storing the position component of the original mesh it can usually contain a lot less vertices.
Think of the case of cubes with hard faces. This requires 24 vertices total (6 faces * 4 vertices). However the position only mesh just requires 8 vertices. This cuts down on the bandwidth for vertex fetching, needs less transforms and makes better use of the post transform cache.
By using the position only VB and IB the original mesh can then be a standard interleaved format.
For the above don't forget to optimise for post-TC and pre-TC, use a position only decl and VS that only transforms position.
Secondly when doing you're frustum culling pass then use a different frustum for the prepass with a much closer far plane so the accepted number of meshes drawn is much lower. There is little gain to drawing meshes far away, firstly they are likely to cover little pixels on the screen, secondly they are less likely to occlude many pixels and thirdly HiZ buffers tend to really lose precision at far distances. It not uncommon to set the far plane to be as close as say 150m.
You can also cull meshes from the prepass using some heuristics. For example Don;t even bother considering meshes which are unlikely to cover many screen pixels.
I usually find it a gain to not draw alpha-tested objects in the prepass but to ensure they get drawn first in the base pass. That way they will benefit from opaque objects in the pre-pass and then update the depth buffer before the opaque objects in the base pass.
#5029238 Alpha Testing: I manage to "scorch" my edges
Posted by AliasBinman
on 05 February 2013 - 05:54 PM
Change the body tofloat4 PS_light_SHADOW(...) : COLOR
{
return tex2D(g_texturemap_sampler, a_texcoord0);
}
float4 col = tex2D(g_texturemap_sampler, a_texcoord0);
return float4(col.rgb/col.a, col.a);
#5029087 Alpha Testing: I manage to "scorch" my edges
Posted by AliasBinman
on 05 February 2013 - 11:22 AM
color.rgb /=color.a;
So as you are start filtering towards a edge pixel you renormalize the colours.
#5026927 Geometry jumping around / distorted on close up(Depth problem?)
Posted by AliasBinman
on 29 January 2013 - 02:45 PM
#5026813 About GPU-Memory interaction
Posted by AliasBinman
on 29 January 2013 - 11:08 AM
B) Typically RTs are not in cache but they do have local ROP tiles which can cache data. These ROP tiles are flushed to VRAM when they are finished being written to or there is a RT switch.
C) Some render states can be pipelined with the draw call. Some can't and are set in one of many state contexts. Potentially some render state changes could cause the pipeline to flush or partially flush leading to bubbles of the GPU going idle. Which can and can't is very much hardware dependent. Also note that some render state switches could potentially cause a lot of work in the driver on the CPU side if the hardware doesn't directly support the feature or the CPU has to do some kind of processing on the data first.
#5012641 Triangle rasterization troubles
Posted by AliasBinman
on 19 December 2012 - 06:09 PM
#5006703 gloss mapping?
Posted by AliasBinman
on 03 December 2012 - 12:14 PM
i.e see how UE4 does it here (slide 30)
http://advances.realtimerendering.com/s2012/Epic/The%20Technology%20Behind%20the%20Elemental%20Demo%2016x9.pptx
Frostbite2 also does it this way too (albeit with maybe a slightly different range)
Also as mentioned above a saturate will be better. Its usually free whereas max is not.
#5005494 Cascade Shadow Map Pixel Shader
Posted by AliasBinman
on 29 November 2012 - 05:23 PM
Typically for orthographic projected cascades you only need to do a single vector by matrix transform. Each cascade can then be done via a bias and scale operation which is a single MAD operation per cascade check.
- Home
- » Viewing Profile: Reputation: AliasBinman

Find content