Babylon 3D engine (Updated for Silverlight 5 RTM)

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.htmlUpdatesUpdate: Support for Silverlight 5 (RTM) Update: Integration of the Silverlight 5 Toolkit: h

C# (4.0 MB)
 
 
 
 
 
4.6 Star
(21)
19,463 times
Add to favorites
12/10/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Problems using the code
    13 Posts | Last post July 28, 2011
    • First, it wouldn't build, then I installed the Build Task Stuff, and it still wouldn't build until I closed VS and restarted it, then it worked.
      
      Second, it compiles, but won't run because of this error in Mainpage.xaml.
      
      Hardware rendering is disabled. Consider activating "EnableGPUAcceleration" on the host.
      
      
      I'm not sure what to do here.  I enabled it in the plugin, but that has no effect at design time, so I'm confused as to what to do next... help!
    • You must set the Babylon.Web as startup project and then set the html page as startup page :)
      
    • That doesn't even come close to answering the question.  I do have the web project as the startup, it dies in the InitializeComponent() of the mainpage, with this exception
      
      "The invocation of the constructor on type 'Babylon.BabylonSurface' that matches the specified binding constraints threw an exception. [Line: 200 Position: 66]"
    • Hum..strange. Babylon will throw an exception if the GPUAcceleration is off. The html file is supposed to have this option activated.
      
      Could you check that the parameter is on on the html page?
    • A couple of things.
      
      1.  I always use the html file as the start page, and it didn't have the GPU turned on, it wasn't even there, but it was on the aspx page.
      
      2.  That is a runtime solution that has absolutely no effect because the error will show up on the xaml page at desigh time, even though it compiles, which is a bti strange.
      
      There must be something in your development environment that you're not including in the code, because this should just work.
    • I just uploaded a new version. Could you try it?
    • Before I start, let me say that I got it to work, and the 3D is IMPRESSIVE.  Here's the details.
      
      1. I haven't checked what you changed, but this time, it died in Engine.cs with a HardwareAccelerationBlockedBySecurityReason exception.
      
      2.  I removed the throw and replaced it with a break, which allowed the main screen to come up.
      
      3.  Once I got the page, I right clicked to bring up the Silverlight menu, selected the permissions tab, and enabled your app because by default all access is denied.
      
      Once I did that, the main screen is very messed up(choppy), but once I selected a scene, it came up, and I was able to do the panorama around it.
      
      This is some really nice stuff you've created here, I'm hoping to get more into it as time goes on.
      
      Thanks for the help as well.
    • You're welcome :)
    • Glad this was resolved.  For others who might encounter this; one more data point to consider:
      
      Vista/Win7 (with Aero [read: WDDM)) - you automatically get hardware acceleration if the flag is set in the HTML markup.
      
      XP - you will need to explicitly opt into providing these permissions.  It sounds like this is what happened to Wolverado but I could be wrong.
    • PS
      Two things:  (1) absolutely amazing work, David! and (2) if you wanted to, you could programmatically detect the failure to opt-in for hardware acceleration and provide an event/warning/whatever for users of the engine.  But I don't mean to sign you up for additional work, end users can easily do this too.  :)
    • Uhuh:) The exception is already there ^^
      When hardware acceleration if off, an exception with explicit message is thrown.
    • oops :)
    • Had a similar problem with the code. I solved it (not really nice, but it workt) so that I could debug it. If you right click on your project (hope you also use Visual Studio ;-) ) choose "Properties". Choose the "Silverlight" tab and check the option "Enable running application out of the browser" (if not already checked). Now the button "Out-of-Browser Settings..." is enabled. Click it and check in the opening mask "Use GPU Acceleration" and "Require elevated trust when running outside the browser". After choose the next Tab "Debug" and choose "Out-of-browser application".
      After that I didn't get any security exception and you can debug your project out of browser. Don't know if it helps you... (oh, and sorry for my bad english :-) )
  • Hardware Acceleration Error
    2 Posts | Last post May 20, 2011
    • Hi,
      
      I am able to compile and run this project, but I am getting "Your video card do not have any hardware acceleration." Error in Babylon.Engine Class at line 70 : "SynchronizationContext = SynchronizationContext.Current;"
      
      Regards
      Rushi
    • Have you set the EnableGPUAcceleration option on your web page (the one that host the silverlight plugin)?
  • How best can I reach you?
    2 Posts | Last post May 16, 2011
    • Where can I find your email David? I will send you my project.
    • davca @ microsoft . com
  • How best can I reach you?
    1 Posts | Last post May 15, 2011
    • Where can I find your email David? I will send you my project.
  • How to use importer.ImportAsynch
    2 Posts | Last post May 15, 2011
    • Hey David I love your stuff. I'm attempting to Load a .obj of a model that I've been working on and am having some issues. Maybe you could help me.
      
       importer.ImportAsync(objStream, GetMaterialStream, GraphicsDeviceManager.Current.GraphicsDevice, ImportationOptions.Optimize);
      
      I call this method in the load of the drawing surface but when it returns in the handler the Model is always null. I think its because I'm not sure what to put in for the Func<string, Stream> parameter of this method.
      The parameters I am using are as follows.
      
      objStream:
      Stream objStream = Application.GetResourceStream(new Uri("/FootBallViz;component/SoccerBallsmall.obj", UriKind.Relative)).Stream;
      
      GetMaterialStream
      ??? -- Don't know what to put for this? -- so I put null...
      
      Device:
      GraphicsDeviceManager.Current.GraphicsDevice
      
      ImportationOptions:
      ImportationOptions.Optimize
      
      
      So when the handler gets called it always returns null. (I know its not due to my model because it is actually being loaded into the stream.
      
       void importer_OnImportCompleted(Model obj)
              {
                  
                  model = obj; //model always == null
              }
      
      Also, is there some kind of "getting started" documentation?  I would love to read through it.
      
      Thanks! And great work!!
      
      - David :)
      
    • Hi David;)
      the best place to start is http://babylontoolkit.codeplex.com
      You can go to the downloads tab and download a project sample.
      
      If you do'nt manage to make your code work, do not hesitate to send me your project and I will look for you where the problem is :)
  • Build fails on BabylonImporter
    2 Posts | Last post May 14, 2011
    • Hi,
      
      I'm having some problems building the solution - the BabylonImporter project fails.  It has a problem with the "Vertice" namespace.
      
      Do I need to install/import anything related to Nova?  Sorry, but I'm a bit of a novice :-(
      
      Many thanks for your help and this amazing resource.
      
      Chris.
    • Hello Chris,
      You have to download the free version of Nova : http://www.vertice.fr/DownloadNovaSdkDemo.aspx
      
      With this sdk, you will be able to export scenes from 3Ds max and import them in babylon :)
  • how to build a scene ??
    2 Posts | Last post May 12, 2011
    • hello,
      
      i hope that someone can help, im interested to build a scene for my house, what are the tools that is available to build a scene to be able to render it in silverlight,,,
      
      thank you for the help
    • You should take a look at Babylon.Toolkit which allows you to import .OBJ files :
      http://babylontoolkit.codeplex.com
      
  • Does that mean it doesn't work on Mac
    5 Posts | Last post April 30, 2011
    • i.e., is this just a Windows technology right now?
    • We understand it's important and we are looking into the experience.
    • <<We understand it's important and we are looking into the experience. 
      Il s'agit de la même réponse que celle faite par Aaron lors de sa session MIX,
      qu'il a faite à cette question évidemment cruciale sur son blog: qu'apporte cette langue de bois?
      Pourquoi ne pas pas clairement annoncer la couleur?
      Je n'imagine pas que la version SL5 pour MacOSX n'offre pas le support XNA, quitte à requérir
      des version GLSL des shaders. Si ça n'était pas le cas, quel serait l'interêt de SL5 par rapport
      à WPF, qui permet déjà, fut ce façon acrobatique, d'intégrer des rendus DirectX?
      
      Ceci dit, bravo pour la démo MIX basée sur Babylon: impressionnant!
      
      
    • Ce n'est pas de la langue de bois. Il y a vraiment une discussion actuellement sur le support de la 3D sur le Mac. Ce qui est sur c'est que ca viendra. La discussion porte plutot sur le quand.
      
      Et oui je suis d'accord c'est crucial.
    • <<Ce qui est sur c'est que ca viendra. 
      C'est tout ce que je voulais entendre: merci :-)!
      Je trouve l'ensemble des technologies et outils formé par WPF/SL/WP7, VS.Net/Expression extraordinaire,
      je souhaite les voir continuer à évoluer, et converger: tout ce qui va dans ce sens me fait plaisir.
      
  • Requirements
    2 Posts | Last post April 26, 2011
    • Does this engine/application require DirectX?
    • Indirectly yes. Silverlight 5 3D uses DirectX to render scenes under Windows.
21 - 29 of 29 Items