Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: ui/gfx/resources/blur.fx

Issue 9288053: Remove old (pre-webkit) compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gfx_resources.grd ('k') | ui/gfx/resources/compositor.fx » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Pixel shader used to do a bloom. It's expected that the consumers set
6 // TexelKernel before using.
7
8 Texture2D textureMap;
9
10 cbuffer cbPerObject {
11 float4x4 gWVP;
12 };
13
14 struct VS_IN {
15 float3 posL : POSITION;
16 float2 texC : TEXC;
17 };
18
19 struct VS_OUT {
20 float4 posW : SV_POSITION;
21 float2 texC : TEXC;
22 };
23
24 SamplerState Sampler {
25 Filter = MIN_MAG_MIP_POINT;
26 AddressU = Clamp;
27 AddressV = Clamp;
28 };
29
30 VS_OUT VS(VS_IN vIn) {
31 VS_OUT vOut;
32 vOut.posW = mul(float4(vIn.posL, 1.0f), gWVP);
33 vOut.texC = vIn.texC;
34 return vOut;
35 }
36
37 // Size of the kernel.
38 static const int g_cKernelSize = 13;
39
40 static const float BlurWeights[g_cKernelSize] = {
41 1.0f / 4096.0f,
42 12.0f / 4096.0f,
43 66.0f / 4096.0f,
44 220.0f / 4096.0f,
45 495.0f / 4096.0f,
46 792.0f / 4096.0f,
47 924.0f / 4096.0f,
48 792.0f / 4096.0f,
49 495.0f / 4096.0f,
50 220.0f / 4096.0f,
51 66.0f / 4096.0f,
52 12.0f / 4096.0f,
53 1.0f / 4096.0f,
54 };
55
56 // Set by consumer as it depends upon width/height of viewport.
57 float4 TexelKernel[g_cKernelSize];
58
59 float4 PS(VS_OUT pIn) : SV_Target {
60 float4 c = 0;
61 for (int i = 0; i < g_cKernelSize; i++) {
62 c += textureMap.Sample(Sampler, float2(pIn.texC) + TexelKernel[i].xy) *
63 BlurWeights[i];
64 }
65 return c;
66 }
67
68 technique10 ViewTech {
69 pass P0 {
70 SetVertexShader(CompileShader(vs_4_0, VS()));
71 SetGeometryShader(NULL);
72 SetPixelShader(CompileShader(ps_4_0, PS()));
73 }
74 }
OLDNEW
« no previous file with comments | « ui/gfx/gfx_resources.grd ('k') | ui/gfx/resources/compositor.fx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698