@@ -172,6 +172,60 @@ void CBlender_BmmD::Compile (CBlender_Compile& C)
172172 break ;
173173 }
174174}
175+ #elif RENDER==R_GL
176+ // ////////////////////////////////////////////////////////////////////////
177+ // GL
178+ // ////////////////////////////////////////////////////////////////////////
179+ #include " uber_deffer.h"
180+ void CBlender_BmmD::Compile (CBlender_Compile& C)
181+ {
182+ IBlender::Compile (C);
183+ // codepath is the same, only the shaders differ
184+ // ***only pixel shaders differ***
185+ string256 mask;
186+ strconcat (sizeof (mask),mask,C.L_textures [0 ].c_str ()," _mask" );
187+ switch (C.iElement )
188+ {
189+ case SE_R2_NORMAL_HQ: // deffer
190+ uber_deffer (C, true , " impl" ," impl" ,false ,oT2_Name[0 ]?oT2_Name:0 ,true );
191+ C.r_Sampler (" s_mask" , mask);
192+ C.r_Sampler (" s_lmap" , C.L_textures [1 ]);
193+
194+ C.r_Sampler (" s_dt_r" , oR_Name, false , D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC,D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC);
195+ C.r_Sampler (" s_dt_g" , oG_Name, false , D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC,D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC);
196+ C.r_Sampler (" s_dt_b" , oB_Name, false , D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC,D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC);
197+ C.r_Sampler (" s_dt_a" , oA_Name, false , D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC,D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC);
198+
199+ C.r_Sampler (" s_dn_r" , strconcat (sizeof (mask),mask,oR_Name," _bump" ) );
200+ C.r_Sampler (" s_dn_g" , strconcat (sizeof (mask),mask,oG_Name," _bump" ) );
201+ C.r_Sampler (" s_dn_b" , strconcat (sizeof (mask),mask,oB_Name," _bump" ) );
202+ C.r_Sampler (" s_dn_a" , strconcat (sizeof (mask),mask,oA_Name," _bump" ) );
203+
204+ C.r_Stencil ( TRUE ,D3DCMP_ALWAYS,0xff ,0x7f ,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
205+ C.r_StencilRef (0x01 );
206+
207+ C.r_End ();
208+ break ;
209+ case SE_R2_NORMAL_LQ: // deffer
210+ uber_deffer (C, false , " base" ," impl" ,false ,oT2_Name[0 ]?oT2_Name:0 ,true );
211+
212+ C.r_Sampler (" s_lmap" , C.L_textures [1 ]);
213+
214+ C.r_Stencil ( TRUE ,D3DCMP_ALWAYS,0xff ,0x7f ,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
215+ C.r_StencilRef (0x01 );
216+
217+ C.r_End ();
218+ break ;
219+ case SE_R2_SHADOW: // smap
220+ // if (RImplementation.o.HW_smap) C.r_Pass ("shadow_direct_base","dumb", FALSE,TRUE,TRUE,FALSE);
221+ // else C.r_Pass ("shadow_direct_base","shadow_direct_base",FALSE);
222+ C.r_Pass (" shadow_direct_base" ," dumb" , FALSE ,TRUE ,TRUE ,FALSE );
223+ C.r_Sampler (" s_base" ,C.L_textures [0 ]);
224+ C.r_ColorWriteEnable (false , false , false , false );
225+ C.r_End ();
226+ break ;
227+ }
228+ }
175229#else
176230// ////////////////////////////////////////////////////////////////////////
177231// R3
0 commit comments