本文整理汇总了C#中Shader.Compile方法的典型用法代码示例。如果您正苦于以下问题:C# Shader.Compile方法的具体用法?C# Shader.Compile怎么用?C# Shader.Compile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shader
的用法示例。
在下文中一共展示了Shader.Compile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public bool Add(Shader shader)
{
if(!shaders.Contains(shader))
{
shader.Compile();
shaders.Add(shader);
System.Console.WriteLine("Added shader: {0}", shader.GetType());
return true;
}
return false;
}
示例2: HandleActorButtonPress
public static void HandleActorButtonPress(object sender, ButtonPressEventArgs args)
{
int new_no;
if (args.Event.Button == 1)
new_no = current_shader + 1;
else
new_no = current_shader - 1;
if (new_no >= 0 & new_no < shader_sources.Length)
{
current_shader = new_no;
Shader shader = new Shader ();
shader.FragmentSource = shader_sources[current_shader];
shader.Compile ();
Actor actor = sender as Actor;
actor.SetShader (shader);
actor.SetShaderParam ("radius", 3.0f);
}
}
示例3: Main
public static void Main()
{
ClutterRun.Init ();
Stage stage = Stage.Default;
stage.SetSize(512, 384);
Shader shader = new Shader ();
shader.FragmentSource = shader_sources[current_shader];
shader.Compile ();
stage.Title = "Shader Test";
stage.Color = new Clutter.Color (0x61, 0x64, 0x8c, 0xff);
Timeline timeline = new Timeline(360, 60);
timeline.Loop = true;
stage.AddActor (new Label ("Mono 16", "Press the Hand"));
Texture actor = new Texture("redhand.png");
actor.SetShader (shader);
actor.Reactive = true;
actor.ButtonPressEvent += HandleActorButtonPress;
stage.AddActor (actor);
actor.SetShaderParam("brightness", 0.4f);
actor.SetShaderParam("contrast", -1.9f);
actor.SetPosition (0, 20);
stage.ShowAll ();
timeline.Start ();
ClutterRun.Main ();
}