源码下载地址:
http://code.msdn.microsoft.com/Babylon-3D-engine-f0404ace/sourcecode?fileId=21297&pathId=1744047981
http://code.msdn.microsoft.com/Babylon-3D-engine-f0404ace
开发调试软件环境:
Silverlight_Developer.exe(文件版本5.0.64010.0), Silverlight5_Tools , Microsoft Express Blend Preview For Silverlight , VS.NET 2010。以上软件均要装英文版的。
DXSDK_Jun10.exe
源码:
Introduction
This sample shows a full 3D realtime engine with some advanced features and an integrated collisions system.
Live sample : http://david.blob.core.windows.net/babylon/Babylon.html
Building the Sample
You need to install ShaderBuildTaskSetup.msi which is present in the folder Babylon/BuildTask in order to compile shaders.
For vertex shaders, you must name the files *.vs.hlsl and set Build Action to VertexShader.
For pixel shaders, you must name the files *.ps.hlsl and set Build Action to PixelShader.
Update : Integration of the new Babylon.Toolkit : http://babylontoolkit.codeplex.com.
Update : New version integrate the new Effect class and the Importer using Nova (http://www.vertice.fr) for 3dsMax.
Description
The engine provides support for:
- Collisions
- Diffuse channel
- Ambient channel
- Textures (including light maps)
- Per-pixel & per-vertex shader
- Models/cameras and lights
Sample of the drawing phase:
void OnDraw(object sender, DrawEventArgs e) { if (engine.Device == null) { engine.Device = e.GraphicsDevice; } engine.BeginFrame(e); if (scene != null && scene.ActiveCamera != null) { scene.Render(); lock (moves) { foreach (MoveDirection move in moves) { scene.ControlManager.CheckKeyboard(move, e.DeltaTime.TotalMilliseconds); } } } engine.EndFrame(); }
The engine provides a user control to quickly integrate a rendering in yours projects:
<Babylon:BabylonSurface x:Name="babylonSurface"/>
var eff = new Effect(engine.Device, "Babylon", "Engine/Shaders/pervertex"); eff.SetConstant("World", World); eff.SetConstant("levels", 1.0f, 0.5f, 0, 1.3f); eff.Apply();
EffectParameter positionParameter = effect.GetParameter("Position"); positionParameter.SetValue(new Vector3(0, 1, 0));
Source Code Files
- Babylon.zip
More Information
For more information, please contact davca@microsoft.com or go to http://blogs.msdn.com/b/eternalcoding