private void SetDesc(ref TextureSamplerDesc desc) { CheckError(Api.rtTextureSamplerSetWrapMode(InternalPtr, 0, (RTwrapmode)desc.Wrap.WrapU)); CheckError(Api.rtTextureSamplerSetWrapMode(InternalPtr, 1, (RTwrapmode)desc.Wrap.WrapV)); CheckError(Api.rtTextureSamplerSetWrapMode(InternalPtr, 2, (RTwrapmode)desc.Wrap.WrapW)); CheckError(Api.rtTextureSamplerSetFilteringModes(InternalPtr, (RTfiltermode)desc.Filter.Min, (RTfiltermode)desc.Filter.Mag, (RTfiltermode)desc.Filter.Mip)); CheckError(Api.rtTextureSamplerSetReadMode(InternalPtr, (RTtexturereadmode)desc.Read)); CheckError(Api.rtTextureSamplerSetIndexingMode(InternalPtr, (RTtextureindexmode)desc.Index)); CheckError(Api.rtTextureSamplerSetMaxAnisotropy(InternalPtr, desc.MaxAnisotropy)); }
public static TextureSamplerDesc GetDefault(WrapMode wrapmode) { var wrap = new WrapUVW(wrapmode, wrapmode, wrapmode); TextureSamplerDesc desc = Default; desc.Wrap = wrap; return(desc); }
/// <summary> /// Create a TextureSampler from a <see cref="TextureSamplerDesc">TextureSamplerDesc</see>. /// </summary> /// <param name="context">Optix context</param> /// <param name="desc">Description of the TextureSampler</param> public TextureSampler(Context context, TextureSamplerDesc desc) : base(context) { CheckError(Api.rtTextureSamplerCreate(context.InternalPtr, out InternalPtr)); SetDesc(ref desc); }