38Ogre::String SGBufferLow::GetGBufferMaterialPixelOutputStructureTypeNameImpl()
40 return "SO3_GBufferLow_PixelShaderOutput";
43Ogre::String SGBufferLow::GetGBufferCompositorPixelInputStructureTypeNameImpl()
45 return "SO3_GBufferLow_PixelShaderInput";
48Ogre::String SGBufferLow::GenerateGBufferMaterialPixelOutputStructureImpl()
50 Ogre::StringStream ss;
54 ss <<
"struct SO3_GBufferLow_PixelShaderOutput : I_GBufferPixelShaderOutput" << std::endl;
55 ss <<
"{" << std::endl;
56 ss <<
" float4 mrt0 : COLOR0; // Diffuse (rgb) + Shininess power (a)" << std::endl;
57 ss <<
" float4 mrt1 : COLOR1; // Normal (rgb) + Depth (a)" << std::endl;
60 ss <<
" void Reset()" << std::endl;
61 ss <<
" {" << std::endl;
62 ss <<
" mrt0 = float4(0, 0, 0, 0);" << std::endl;
63 ss <<
" mrt1 = float4(0, 0, 0, 0);" << std::endl;
64 ss <<
" }" << std::endl;
67 ss <<
" float3 GetDiffuse()" << std::endl;
68 ss <<
" {" << std::endl;
69 ss <<
" return mrt0.rgb;" << std::endl;
70 ss <<
" }" << std::endl;
73 ss <<
" void SetDiffuse(in float3 diffuse)" << std::endl;
74 ss <<
" {" << std::endl;
75 ss <<
" mrt0.rgb = diffuse;" << std::endl;
76 ss <<
" }" << std::endl;
80 ss <<
" float3 GetSpecular()" << std::endl;
81 ss <<
" {" << std::endl;
82 ss <<
" return float3(1, 1, 1);" << std::endl;
83 ss <<
" }" << std::endl;
87 ss <<
" void SetSpecular(in float3 specular)" << std::endl;
88 ss <<
" {" << std::endl;
89 ss <<
" // Nothing to do" << std::endl;
90 ss <<
" }" << std::endl;
93 ss <<
" float GetShininess()" << std::endl;
94 ss <<
" {" << std::endl;
95 ss <<
" return mrt0.a;" << std::endl;
96 ss <<
" }" << std::endl;
99 ss <<
" void SetShininess(in float shininess)" << std::endl;
100 ss <<
" {" << std::endl;
101 ss <<
" mrt0.a = shininess;" << std::endl;
102 ss <<
" }" << std::endl;
105 ss <<
" float3 GetNormal()" << std::endl;
106 ss <<
" {" << std::endl;
107 ss <<
" return mrt1.rgb;" << std::endl;
108 ss <<
" }" << std::endl;
111 ss <<
" void SetNormal(in float3 normal)" << std::endl;
112 ss <<
" {" << std::endl;
113 ss <<
" mrt1.rgb = normal;" << std::endl;
114 ss <<
" }" << std::endl;
117 ss <<
" float GetDepth()" << std::endl;
118 ss <<
" {" << std::endl;
119 ss <<
" return mrt1.a;" << std::endl;
120 ss <<
" }" << std::endl;
123 ss <<
" void SetDepth(in float depth)" << std::endl;
124 ss <<
" {" << std::endl;
125 ss <<
" mrt1.a = depth;" << std::endl;
126 ss <<
" }" << std::endl;
130 ss <<
" float GetEmissive()" << std::endl;
131 ss <<
" {" << std::endl;
132 ss <<
" return float(0);" << std::endl;
133 ss <<
" }" << std::endl;
137 ss <<
" void SetEmissive(in float emissive)" << std::endl;
138 ss <<
" {" << std::endl;
139 ss <<
" // Nothing to do" << std::endl;
140 ss <<
" }" << std::endl;
144 ss <<
" float GetMaterialID()" << std::endl;
145 ss <<
" {" << std::endl;
146 ss <<
" return float(0);" << std::endl;
147 ss <<
" }" << std::endl;
151 ss <<
" void SetMaterialID(in float materialId)" << std::endl;
152 ss <<
" {" << std::endl;
153 ss <<
" // Nothing to do" << std::endl;
154 ss <<
" }" << std::endl;
158 ss <<
" float2 GetVelocity()" << std::endl;
159 ss <<
" {" << std::endl;
160 ss <<
" return float2(0, 0);" << std::endl;
161 ss <<
" }" << std::endl;
165 ss <<
" void SetVelocity(in float2 velocity)" << std::endl;
166 ss <<
" {" << std::endl;
167 ss <<
" // Nothing to do" << std::endl;
168 ss <<
" }" << std::endl;
169 ss <<
"};" << std::endl;
175Ogre::String SGBufferLow::GenerateGBufferCompositorPixelInputStructureImpl()
177 Ogre::StringStream ss;
181 ss <<
"struct SO3_GBufferLow_PixelShaderInput : I_GBufferPixelShaderInput" << std::endl;
182 ss <<
"{" << std::endl;
183 ss <<
" uniform sampler2D mrt0 : register(s0); // Diffuse (rgb) + Shininess power (a)" << std::endl;
184 ss <<
" uniform sampler2D mrt1 : register(s1); // Normal (rgb) + Depth (a)" << std::endl;
187 ss <<
" float3 GetDiffuse(in float2 coordinate)" << std::endl;
188 ss <<
" {" << std::endl;
189 ss <<
" return tex2D(mrt0, coordinate).rgb;" << std::endl;
190 ss <<
" }" << std::endl;
194 ss <<
" float3 GetSpecular(in float2 coordinate)" << std::endl;
195 ss <<
" {" << std::endl;
196 ss <<
" return float3(0, 0, 0);" << std::endl;
197 ss <<
" }" << std::endl;
200 ss <<
" float GetShininess(in float2 coordinate)" << std::endl;
201 ss <<
" {" << std::endl;
202 ss <<
" return tex2D(mrt0, coordinate).a;" << std::endl;
203 ss <<
" }" << std::endl;
206 ss <<
" float3 GetNormal(in float2 coordinate)" << std::endl;
207 ss <<
" {" << std::endl;
208 ss <<
" return tex2D(mrt1, coordinate).rgb;" << std::endl;
209 ss <<
" }" << std::endl;
212 ss <<
" float GetDepth(in float2 coordinate)" << std::endl;
213 ss <<
" {" << std::endl;
214 ss <<
" return tex2D(mrt1, coordinate).a;" << std::endl;
215 ss <<
" }" << std::endl;
219 ss <<
" float GetEmissive(in float2 coordinate)" << std::endl;
220 ss <<
" {" << std::endl;
221 ss <<
" return float(0);" << std::endl;
222 ss <<
" }" << std::endl;
226 ss <<
" float GetMaterialID(in float2 coordinate)" << std::endl;
227 ss <<
" {" << std::endl;
228 ss <<
" return float(0);" << std::endl;
229 ss <<
" }" << std::endl;
233 ss <<
" float2 GetVelocity(in float2 coordinate)" << std::endl;
234 ss <<
" {" << std::endl;
235 ss <<
" return float2(0, 0);" << std::endl;
236 ss <<
" }" << std::endl;
237 ss <<
"};" << std::endl;