Changeset 1774
- Timestamp:
- Aug 18, 2012, 11:54:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gpu/framebuffer.cpp
r1773 r1774 65 65 if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1, 66 66 D3DUSAGE_RENDERTARGET, 67 D3DFMT_ R8G8B8, D3DPOOL_DEFAULT,67 D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 68 68 &m_data->m_texture, NULL))) 69 69 Abort(); -
trunk/tutorial/08_fbo.lolfx
r1737 r1774 54 54 55 55 void main(float2 in_Position : POSITION, 56 out float2 pass_Position : TEXCOORD0, 56 57 out float4 out_Position : POSITION) 57 58 { 59 pass_Position = in_Position; 58 60 out_Position = float4(in_Position, 0.0, 1.0); 59 61 } … … 61 63 -- HLSL.Frag -- 62 64 63 void main(out float4 out_FragColor : COLOR) 65 void main(in float2 pass_Position : TEXCOORD0, 66 uniform sampler2D in_Texture, 67 uniform float in_Flag, 68 uniform float3 in_Point, 69 uniform float3 in_Color, 70 out float4 out_FragColor : COLOR) 64 71 { 65 out_FragColor = float4(0.7, 0.2, 0.5, 1.0); 72 if (in_Flag == 0.0) 73 { 74 float tc = 0.0, ta = 0.0; 75 { 76 float s = 6.0 + 3.0 * in_Point.z; 77 float2 p = pass_Position - in_Point.xy * 0.8; 78 float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0); 79 float u = t * t * t * t; 80 tc += 3.0 * t * t - 2.0 * t * t * t; 81 ta += 3.0 * u * u - 2.0 * u * u * u; 82 } 83 84 out_FragColor = float4(tc * in_Color, ta + 0.1); 85 } 86 else 87 { 88 float2 texcoords = pass_Position * 0.5 + float2(0.5, 0.5); 89 out_FragColor = float4(tex2D(in_Texture, texcoords).xyz, 1.0); 90 } 66 91 } 67 92
Note: See TracChangeset
for help on using the changeset viewer.