本文整理汇总了C#中SceneManager.CreateBillboardSet方法的典型用法代码示例。如果您正苦于以下问题:C# SceneManager.CreateBillboardSet方法的具体用法?C# SceneManager.CreateBillboardSet怎么用?C# SceneManager.CreateBillboardSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneManager
的用法示例。
在下文中一共展示了SceneManager.CreateBillboardSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MovableText
public MovableText(string name, SceneManager sceneMgr, SceneNode node, Size size)
{
this.texture = TextureManager.Singleton.CreateManual(
name + "Texture",
ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME,
TextureType.TEX_TYPE_2D,
(uint)size.Width,
(uint)size.Height,
0,
PixelFormat.PF_A8R8G8B8);
this.material = MaterialManager.Singleton.Create(name + "Material", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);
this.material.GetTechnique(0).GetPass(0).CreateTextureUnitState(this.texture.Name);
this.material.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
this.material.SetDepthCheckEnabled(false);
this.billboardSet = sceneMgr.CreateBillboardSet();
this.billboardSet.SetMaterialName(this.material.Name);
this.billboardSet.RenderQueueGroup = (byte)RenderQueueGroupID.RENDER_QUEUE_OVERLAY;
this.billboard = this.billboardSet.CreateBillboard(Vector3.ZERO);
this.billboard.SetDimensions(size.Width, size.Height);
this.billboard.Colour = ColourValue.ZERO;
node.AttachObject(this.billboardSet);
this.sceneMgr = sceneMgr;
this.size = size;
}
示例2: BillboardSystem
public BillboardSystem(SceneManager sceneManager, SceneNode worldNode, string materialName, Mogre.BillboardType type, Vector2 defaultDimension, float defaultTimeToLive)
{
BillboardSet = sceneManager.CreateBillboardSet();
BillboardSet.SetMaterialName(materialName);
BillboardSet.SetBillboardsInWorldSpace(true);
BillboardSet.BillboardType = type;
worldNode.AttachObject(BillboardSet);
this.DefaultDimension = defaultDimension;
this.DefaultTimeToLive = defaultTimeToLive;
}
示例3: StaticBillboardSet
//.........这里部分代码省略.........
" out float4 oColor : COLOR, \n" +
" out float4 oFog : FOG, \n" +
" uniform float4x4 worldViewProj, \n" +
" uniform float uScroll, \n" +
" uniform float vScroll, \n" +
" uniform float4 preRotatedQuad[4] ) \n" +
"{ \n" +
//Face the camera
" float4 vCenter = float4( position.x, position.y, position.z, 1.0f ); \n" +
" float4 vScale = float4( normal.x, normal.y, normal.x, 1.0f ); \n" +
" oPosition = mul( worldViewProj, vCenter + (preRotatedQuad[normal.z] * vScale) ); \n" +
//Color
" oColor = color; \n" +
//UV Scroll
" oUv = uv; \n" +
" oUv.x += uScroll; \n" +
" oUv.y += vScroll; \n" +
//Fog
" oFog.x = oPosition.z; \n" +
"}";
vertexShader = HighLevelGpuProgramManager.Instance.CreateProgram(
"Sprite_vp",
ResourceGroupManager.DefaultResourceGroupName,
"cg", GpuProgramType.Vertex);
vertexShader.Source = vertexProg;
vertexShader.SetParam("profiles", "vs_1_1 arbvp1");
vertexShader.SetParam("entry_point", "Sprite_vp");
vertexShader.Load();
}
//Second shader, camera alignment and distance based fading
HighLevelGpuProgram vertexShader2 =
(HighLevelGpuProgram)HighLevelGpuProgramManager.Instance.GetByName("SpriteFade_vp");
if (vertexShader2 == null)
{
string vertexProg2 = string.Empty;
vertexProg2 =
"void SpriteFade_vp( \n" +
" float4 position : POSITION, \n" +
" float3 normal : NORMAL, \n" +
" float4 color : COLOR, \n" +
" float2 uv : TEXCOORD0, \n" +
" out float4 oPosition : POSITION, \n" +
" out float2 oUv : TEXCOORD0, \n" +
" out float4 oColor : COLOR, \n" +
" out float4 oFog : FOG, \n" +
" uniform float4x4 worldViewProj, \n" +
" uniform float3 camPos, \n" +
" uniform float fadeGap, \n" +
" uniform float invisibleDist, \n" +
" uniform float uScroll, \n" +
" uniform float vScroll, \n" +
" uniform float4 preRotatedQuad[4] ) \n" +
"{ \n" +
//Face the camera
" float4 vCenter = float4( position.x, position.y, position.z, 1.0f ); \n" +
" float4 vScale = float4( normal.x, normal.y, normal.x, 1.0f ); \n" +
" oPosition = mul( worldViewProj, vCenter + (preRotatedQuad[normal.z] * vScale) ); \n" +
" oColor.rgb = color.rgb; \n" +
//Fade out in the distance
" float dist = distance(camPos.xz, position.xz); \n" +
" oColor.a = (invisibleDist - dist) / fadeGap; \n" +
//UV scroll
" oUv = uv; \n" +
" oUv.x += uScroll; \n" +
" oUv.y += vScroll; \n" +
//Fog
" oFog.x = oPosition.z; \n" +
"}";
vertexShader2 = HighLevelGpuProgramManager.Instance.CreateProgram(
"SpriteFade_vp",
ResourceGroupManager.DefaultResourceGroupName,
"cg", GpuProgramType.Vertex);
vertexShader2.Source = vertexProg2;
vertexShader2.SetParam("profiles", "vs_1_1 arbvp1");
vertexShader2.SetParam("entry_point", "SpriteFade_vp");
vertexShader2.Load();
}
}
}
else
{
//Compatible billboard method
mFallbackSet = mSceneMgr.CreateBillboardSet(GetUniqueID("SBS"), 100);
mNode.AttachObject(mFallbackSet);
}
}