Changeset 1908
Legend:
- Unmodified
- Added
- Removed
-
trunk/Media/Materials/CelShading.material
r448 r1908 1 vertex_program Ogre/CelShading VPcg1 vertex_program Ogre/CelShadingCG_vp cg 2 2 { 3 3 source Example_CelShading.cg 4 4 entry_point main_vp 5 5 profiles vs_1_1 arbvp1 6 } 6 7 8 fragment_program Ogre/CelShadingCG_fp cg 9 { 10 source Example_CelShading.cg 11 entry_point main_fp 12 profiles ps_1_1 arbfp1 fp20 13 } 14 15 vertex_program Ogre/CelShadingHLSL_vp hlsl 16 { 17 source Example_CelShading.hlsl 18 entry_point main_vp 19 target vs_1_1 arbvp1 20 } 21 22 fragment_program Ogre/CelShadingHLSL_fp hlsl 23 { 24 source Example_CelShading.hlsl 25 entry_point main_fp 26 target ps_2_0 27 } 28 29 vertex_program Ogre/CelShadingVP unified 30 { 31 delegate Ogre/CelShadingHLSL_vp 32 delegate Ogre/CelShadingCG_vp 7 33 default_params 8 34 { … … 11 37 param_named_auto worldViewProj worldviewproj_matrix 12 38 param_named shininess float 10 13 } 39 } 14 40 } 15 41 16 fragment_program Ogre/CelShadingFP cg42 fragment_program Ogre/CelShadingFP unified 17 43 { 18 source Example_CelShading.cg 19 entry_point main_fp 20 profiles ps_1_1 arbfp1 fp20 44 delegate Ogre/CelShadingHLSL_fp 45 delegate Ogre/CelShadingCG_fp 21 46 } 22 23 47 24 48 material Examples/CelShading … … 61 85 } 62 86 } 87 63 88 } 64 89 -
trunk/Projects/Axiom/Engine/Graphics/UnifiedHighLevelGpuProgram.cs
r1663 r1908 72 72 private List<String> _delegateNames = new List<string>(); 73 73 74 private HighLevelGpuProgram _chosenDel gate;74 private HighLevelGpuProgram _chosenDelegate; 75 75 public HighLevelGpuProgram Delegate 76 76 { 77 77 get 78 78 { 79 if ( _chosenDel gate == null )79 if ( _chosenDelegate == null ) 80 80 chooseDelegate(); 81 return _chosenDel gate;81 return _chosenDelegate; 82 82 } 83 83 } … … 104 104 protected virtual void chooseDelegate() 105 105 { 106 _chosenDel gate = null;106 _chosenDelegate = null; 107 107 foreach ( string delegateName in _delegateNames ) 108 108 { 109 HighLevelGpuProgram program = HighLevelGpuProgramManager.Instance[ delegateName ];110 if ( program != null && program.IsSupported )111 {112 _chosenDelgate = program;113 break;114 }109 HighLevelGpuProgram program = HighLevelGpuProgramManager.Instance[ delegateName ]; 110 if ( program != null && program.IsSupported ) 111 { 112 _chosenDelegate = program; 113 break; 114 } 115 115 } 116 116 } … … 131 131 _delegateNames.Add( delegateName ); 132 132 // Invalidate current selection 133 _chosenDel gate = null;133 _chosenDelegate = null; 134 134 } 135 135 … … 141 141 _delegateNames.Clear(); 142 142 // Invalidate current selection 143 _chosenDel gate = null;143 _chosenDelegate = null; 144 144 } 145 145 … … 152 152 get 153 153 { 154 if ( _chosenDelgate != null )155 { 156 return _chosenDelgate.BindingDelegate;154 if ( Delegate != null ) 155 { 156 return Delegate.BindingDelegate; 157 157 } 158 158 … … 165 165 get 166 166 { 167 if ( _chosenDelgate != null )168 { 169 return _chosenDelgate.IsMorphAnimationIncluded;167 if ( Delegate != null ) 168 { 169 return Delegate.IsMorphAnimationIncluded; 170 170 } 171 171 … … 174 174 set 175 175 { 176 if ( _chosenDelgate != null )177 _chosenDelgate.IsMorphAnimationIncluded = value;176 if ( Delegate != null ) 177 Delegate.IsMorphAnimationIncluded = value; 178 178 } 179 179 } … … 183 183 get 184 184 { 185 if ( _chosenDelgate != null )186 { 187 return _chosenDelgate.IsSkeletalAnimationIncluded;185 if ( Delegate != null ) 186 { 187 return Delegate.IsSkeletalAnimationIncluded; 188 188 } 189 189 return false; … … 191 191 set 192 192 { 193 if ( _chosenDelgate != null )194 _chosenDelgate.IsSkeletalAnimationIncluded = value;193 if ( Delegate != null ) 194 Delegate.IsSkeletalAnimationIncluded = value; 195 195 } 196 196 } … … 200 200 get 201 201 { 202 if ( _chosenDelgate != null )203 { 204 return _chosenDelgate.PoseAnimationCount;202 if ( Delegate != null ) 203 { 204 return Delegate.PoseAnimationCount; 205 205 } 206 206 return 0; … … 208 208 set 209 209 { 210 if ( _chosenDelgate != null )211 _chosenDelgate.PoseAnimationCount = value;210 if ( Delegate != null ) 211 Delegate.PoseAnimationCount = value; 212 212 } 213 213 } … … 217 217 get 218 218 { 219 return _chosenDelgate != null;219 return Delegate != null; 220 220 } 221 221 } … … 225 225 get 226 226 { 227 if ( _chosenDelgate != null )228 { 229 return _chosenDelgate.PassSurfaceAndLightStates;227 if ( Delegate != null ) 228 { 229 return Delegate.PassSurfaceAndLightStates; 230 230 } 231 231 return false; … … 233 233 set 234 234 { 235 if ( _chosenDelgate != null ) 236 _chosenDelgate.PassSurfaceAndLightStates = value; 237 } 238 } 235 if ( Delegate != null ) 236 Delegate.PassSurfaceAndLightStates = value; 237 } 238 } 239 240 public override bool HasDefaultParameters 241 { 242 get 243 { 244 if ( Delegate != null ) 245 { 246 return Delegate.HasDefaultParameters; 247 } 248 return false; 249 } 250 } 251 252 public override GpuProgramParameters DefaultParameters 253 { 254 get 255 { 256 if ( Delegate != null ) 257 { 258 return Delegate.DefaultParameters; 259 } 260 return null; 261 } 262 } 239 263 240 264 public override GpuProgramParameters CreateParameters() … … 253 277 } 254 278 255 protected override void CreateLowLevelImpl() 279 public override bool SetParam( string name, string val ) 280 { 281 switch ( name ) 282 { 283 case "delegate": 284 AddDelegateProgram( val ); 285 return true; 286 break; 287 } 288 return false; 289 } 290 291 public override void Load( bool background ) 292 { 293 if ( Delegate != null ) 294 Delegate.Load( background ); 295 } 296 297 protected override void CreateLowLevelImpl() 256 298 { 257 299 throw new Exception( "The method or operation is not implemented." ); … … 268 310 } 269 311 270 public override bool SetParam( string name, string val )271 {272 switch ( name )273 {274 case "delegate":275 AddDelegateProgram( val );276 return true;277 break;278 }279 return false;280 }281 282 312 protected override void LoadFromSource() 283 313 { … … 289 319 get 290 320 { 291 if ( _chosenDelgate != null )292 { 293 return _chosenDelgate.SamplerCount;321 if ( Delegate != null ) 322 { 323 return Delegate.SamplerCount; 294 324 } 295 325 return 0; -
trunk/Projects/AxiomDemos/Source/Browser/WinForm/Axiom.Demos.Browser.WinForm.csproj
r1895 r1908 105 105 <SubType>Code</SubType> 106 106 </Compile> 107 <None Include="..\..\..\..\..\Media\GpuPrograms\Example_CelShading.hlsl"> 108 <Link>Media\GpuPrograms\Example_CelShading.hlsl</Link> 109 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 110 </None> 107 111 <None Include="..\..\..\..\..\Media\Materials\Example.particle"> 108 112 <Link>Media\Materials\Example.particle</Link> … … 602 606 <None Include="..\..\..\..\..\Media\Materials\Glass.material"> 603 607 <Link>Media\Materials\Glass.material</Link> 604 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>605 </None>606 <None Include="..\..\..\..\..\Media\Materials\hdr.material">607 <Link>Media\Materials\hdr.material</Link>608 608 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 609 609 </None>
