protected override bool ResolveParameters(ProgramSet programSet) { //resolve parameter for normal texturing procedures bool isSuccess = base.ResolveParameters(programSet); if (isSuccess) { //resolve source modification parameters Program psProgram = programSet.CpuFragmentProgram; for (int i = this.textureBlends.Count - 1; i >= 0; i--) { TextureBlend texBlend = this.textureBlends[i]; if ((texBlend.SourceModifier != SourceModifier.Invalid) && (texBlend.SourceModifier != SourceModifier.None)) { texBlend.ModControlParam = psProgram.ResolveAutoParameterInt(Graphics.GpuProgramParameters.AutoConstantType.Custom, texBlend.CustomNum); if (texBlend.ModControlParam == null) { isSuccess = false; break; } } } } return(isSuccess); }
public OctreeModelSceneNode(SceneScreen screen, Drome.Objects.OctreeModel model) : base(screen, model, model.Physics) { this.OctreeModel = model; if (OctreeModel.VOMFilename == "") { return; } try { using (System.IO.MemoryStream ms = new System.IO.MemoryStream(Program.Filesystem.GetFileData(Program.Filesystem.GetFileEntry(OctreeModel.VOMFilename)))) using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms)) { VOMFile = new VOMFile(reader); List <SceneScreen.RenderTexture> textures = new List <SceneScreen.RenderTexture>(); foreach (TextureReference texref in VOMFile.BitmapIndices) { textures.Add(screen.LoadTextureReference(texref)); } //VOMFile.ExportOBJ("vom.obj"); foreach (RenderGroup rg in VOMFile.RenderGroups) { SceneScreen.Mesh mesh = new SceneScreen.Mesh(screen.Renderer.D3DDevice, rg); TextureBlend baseBlend = rg.TextureBlends.First(b => b.Effect == Texture.MapType.Base); if (baseBlend.TextureIndex < textures.Count) { mesh.DiffuseTexture = textures[baseBlend.TextureIndex]; } else { System.Diagnostics.Debug.WriteLine("ERROR: TextureBlend.TextureIndex out of range!"); mesh.DiffuseTexture = new SceneScreen.RenderTexture(screen.GetTexture("__error")); } Meshes.Add(mesh); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception loading octree file: " + OctreeModel.VOMFilename); } }
// Use this for initialization void Start() { if (operateOn == OperateON.GPU) { LoadMaterials(); } if (startOnFirstKey && useCurve) { currentCurve = curve.keys[0].time; } if (executeTrigger == Brightness.ExecuteON.Start) { if (!IsExecuting) { IsExecuting = true; StartCoroutine(updateValues()); } if (useCurve) { AdjustBlendingCurve(options, BlendTexture); } else { AdjustBlending(level, options, BlendTexture); } } else if (executeTrigger == Brightness.ExecuteON.Trigger) { blendNow += new TextureBlend(Blend_blendNow); } else if (IsExecuting) { AdjustBlending(level, options, BlendTexture); } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureBlend obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }