/// <summary>
 /// Initializes a new instance of the <see cref="MaterialStreamDescriptor"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="filter">The filter.</param>
 /// <exception cref="System.ArgumentNullException">
 /// name
 /// or
 /// stream
 /// </exception>
 public MaterialStreamDescriptor(string name, string stream, ShaderSource filter = null)
 {
     if (name == null) throw new ArgumentNullException("name");
     if (stream == null) throw new ArgumentNullException("stream");
     Name = name;
     Stream = stream;
     Filter = filter ?? GetDefaultFilter(stream, typeof(Color3));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShaderMixinDiscardException"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 public ShaderMixinDiscardException(ShaderSource source)
 {
     DiscardSource = source;
 }
Esempio n. 3
0
 public SkyBoxPlugin(string name, ShaderSource skyBoxComposition)
     : base(name)
 {
     Texture = null;
     SkyBoxColor = skyBoxComposition;
 }
Esempio n. 4
0
        /// <summary>
        /// Build a encapsulating ShaderMixinSource if necessary.
        /// </summary>
        /// <param name="shaderSource">The input ShaderSource.</param>
        /// <returns>A ShaderMixinSource</returns>
        public static ShaderMixinSource GetShaderMixinSource(ShaderSource shaderSource)
        {
            if (shaderSource is ShaderClassSource)
            {
                var mixin = new ShaderMixinSource();
                mixin.Mixins.Add((ShaderClassSource)shaderSource);
                return mixin;
            }
            if (shaderSource is ShaderMixinSource)
                return (ShaderMixinSource)shaderSource;

            return null;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShaderMixinDiscardException"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 public ShaderMixinDiscardException(ShaderSource source)
 {
     DiscardSource = source;
 }
Esempio n. 6
0
 /// <summary>
 /// Adds a composition to this mixin.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="shaderSource">The shader source.</param>
 public void AddComposition(string name, ShaderSource shaderSource)
 {
     Compositions[name] = shaderSource;
 }
Esempio n. 7
0
 public DefaultEffectMixinProvider(string name)
 {
     shaderSource = new ShaderClassSource(name);
 }