Esempio n. 1
0
 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));
 }
Esempio n. 2
0
        public static TextureSamplerDesc GetDefault(WrapMode wrapmode)
        {
            var wrap = new WrapUVW(wrapmode, wrapmode, wrapmode);

            TextureSamplerDesc desc = Default;

            desc.Wrap = wrap;

            return(desc);
        }
Esempio n. 3
0
 /// <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);
 }