public static SamplerData ToSamplerData(this MatlAttribute.MatlSampler samplerStruct) { var sampler = new SamplerData { WrapS = samplerStruct.WrapS.ToOpenTk(), WrapT = samplerStruct.WrapT.ToOpenTk(), WrapR = samplerStruct.WrapR.ToOpenTk(), MagFilter = samplerStruct.MagFilter.ToOpenTk(), MinFilter = samplerStruct.MinFilter.ToOpenTk(), LodBias = samplerStruct.LodBias, }; if (samplerStruct.TextureFilteringType == FilteringType.AnisotropicFiltering) { sampler.MaxAnisotropy = samplerStruct.MaxAnisotropy; } else { sampler.MaxAnisotropy = 1; } return(sampler); }
public void UpdateSampler(MatlEnums.ParamId paramId, SamplerData sampler) { samplerUpdates.Enqueue(new Tuple <MatlEnums.ParamId, SamplerData>(paramId, sampler)); shouldUpdateTexturesAndSamplers = true; }