This project is read-only.

Xen 2.0 alpha (early)

Jun 12, 2010 at 2:36 AM
Edited Jun 12, 2010 at 2:36 AM

xen.codeplex.com/releases/view/47060

Jun 12, 2010 at 2:42 AM
Edited Jun 12, 2010 at 2:42 AM

As usual, feedback appreciated. :-)

Jun 12, 2010 at 9:55 AM

Got a lot of red during prebuild of the Xen.Ex project.  That followed a swathe of warnings about unresolved cref attributes.  It's been a while since I've done a pre-build.  I can't remember if I need to uninstall the previous veersion of Xen.  I'll work on it and see if I can figure out what's causing the issue.

(CoreCompile target) ->
  Graphics\Display\VelocityBillboard3D.cs(91,4): error CS0246: The type or name
space name 'DrawVelocityBillboardParticles_GpuTex3D' could not be found (are yo
u missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(92,4): error CS0246: The type or name
space name 'DrawVelocityBillboardParticlesColour_GpuTex3D' could not be found (
are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(94,4): error CS0246: The type or name
space name 'DrawVelocityBillboardParticles_GpuTex3D_UserOffset' could not be fo
und (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(95,4): error CS0246: The type or name
space name 'DrawVelocityBillboardParticlesColour_GpuTex3D_UserOffset' could not
 be found (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(119,37): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticlesColour_GpuTex3D' could not be found
 (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(133,39): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticles_GpuTex3D' could not be found (are
you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(149,40): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticlesColour_GpuTex3D_UserOffset' could n
ot be found (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(164,42): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticles_GpuTex3D_UserOffset' could not be
found (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(247,4): error CS0246: The type or nam
espace name 'DrawVelocityBillboardParticles_BillboardCpu3D' could not be found
(are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(248,4): error CS0246: The type or nam
espace name 'DrawVelocityBillboardParticlesColour_BillboardCpu3D' could not be
found (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(252,36): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticlesColour_BillboardCpu3D' could not be
 found (are you missing a using directive or an assembly reference?)
  Graphics\Display\VelocityBillboard3D.cs(258,38): error CS0246: The type or na
mespace name 'DrawVelocityBillboardParticles_BillboardCpu3D' could not be found
 (are you missing a using directive or an assembly reference?)

Jun 12, 2010 at 10:34 AM
Edited Jun 12, 2010 at 11:31 AM

Can you go into the corresponding files and see if they have an error message listed. Eg xen\src\Xen.Ex\Graphics\Display\Billboard.fx.cs

The shader compiler has radically changed, so it's possible it's still trying to use the old one. Can you try running the shader update batch file in the src directory.

 

Jun 12, 2010 at 9:55 PM

Yeah, the fx.cs files aren't generating.  The ModelImporter (and I assume other importers) aren't getting registered either, but I don't know if that's because the red I'm getting is a fatal error that's preventing the importers from being processed.

Running the xen update FX batch didn't change anything, running the prebuild afterwards gave the same error.  I also ran the xen unregister FX batch, and then the prebuild, and then the update FX, and then the prebuild again.  Same issue.  I'm scattershotting a bit, cuz I'm supposed to be somewhere else...

Error message in one of the .fx.cs file:

// XenFX

// Assembly = Xen.Graphics.ShaderSystem.CustomTool, Version=7.0.1.1, Culture=neutral, PublicKeyToken=e706afd07878dfca

// SourceFile = C:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Ex\Graphics\Display\VelocityBillboard3D.fx

// Namespace = Xen.Ex.Graphics.Display

// Unhandled exception in XenFX:

//System.TypeInitializationException: The type initializer for 'Xen.Graphics.ShaderSystem.CustomTool.Graphics' threw an exception. ---> System.InvalidOperationException: An unexpected error has occurred.

// at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor(GraphicsAdapter adapter, DeviceType deviceType, IntPtr renderWindowHandle, PresentationParameters presentationParameters)

// at Xen.Graphics.ShaderSystem.CustomTool.Graphics..cctor() in >snip<\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\Graphics.cs:line 40

// --- End of inner exception stack trace ---

// at Xen.Graphics.ShaderSystem.CustomTool.Graphics.get_GraphicsDevice()

// at Xen.Graphics.ShaderSystem.CustomTool.FX.DecompiledEffect..ctor(SourceShader source, Platform platform) in c:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\FX\FxDecompiler.cs:line 72

// at Xen.Graphics.ShaderSystem.CustomTool.FX.AsmTechnique.ExtractTechniques(SourceShader shader, Platform platform, DecompiledEffect& fx) in c:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\FX\Technique.cs:line 37

// at Xen.Graphics.ShaderSystem.CustomTool.FX.SourceShader.ExtractAsmTechniques() in c:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\FX\SourceShader.cs:line 87

// at Xen.Graphics.ShaderSystem.CustomTool.FX.SourceShader..ctor(String shaderSource, String filename, Boolean extractAsmTechniques) in c:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\FX\SourceShader.cs:line 66

// at Xen.Graphics.ShaderSystem.CustomTool.ShaderCodeGenerator.GenerateCode(String inputFileName, String inputFileContent, String fileNameSpace, CodeDomProvider codeProvider) in c:\Users\min\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Graphics.ShaderSystem\Xen.Graphics.ShaderSystem.CustomTool\PluginEntry.cs:line 40

Jun 12, 2010 at 10:01 PM
Edited Jun 12, 2010 at 10:02 PM

That's really odd. The GraphicsDevice is failing to initalise. That code hasn't changed at all. 1.8 is still working?

Can you fire up the Direct3D debug runtime and a debug monitor such as dbgview, and see what errors (if any) it outputs? Cheers.

Jun 13, 2010 at 7:19 AM

Nope.  1.8.1 is now dead...  (Or...  AAAAAAAGGGGGGHHHHHH!!!!!  1.81 IS NOW DEAD!!!!!)  Of course it would be after I spent all night doing low-level hacking to support a wpf host control for Xen (not successfully... yet) so the 1.81 prebuild is hacking up furballs because of all my construction/destruction...

 

 

Ok, so after pulling all my garbage back out so that the prebuild would run again, 1.81 is no longer dead. 

 With the debug runtimes for DX9, and with Dbgwiew capturing absolutely everything, the prebuild for 2.0 shows... nothing at all.  (I made sure it was capturing ok by running a tutorial from 1.81 first)  One thing I can think of is my version of the SDK is really old... March 2009 IIRC.  Don't know if that's likely to be an issue.   FWIW, I'm running an nVidia 8800GTS on this machine... It's a DX10 part, SM4.0

 Looking a little more thoroughly at the .fx.cs files, most of them are actually building ok.  It's just VelocityBillboard3D that has the error above, and DepthInstance has a slightly different error;

 // XenFX

 // Assembly = Xen.Graphics.ShaderSystem.CustomTool, Version=7.0.1.1, Culture=neutral, PublicKeyToken=e706afd07878dfca

 // SourceFile =>snip<\Documents\Visual Studio 2008\Projects\xen_2_0\xen\src\Xen.Ex\Shaders\DepthInstance.fx

 // Namespace = Xen.Ex.Shaders

 // Error generating shader:

 //XenFX Platform Technique Extraction Failed (This may be a bug): (line: 0 col: 0)

 // Error generating shader:

 //(0): error X3041: unsupported compiler target 'VS_TARGET' (line: 0 col: 0)

Jun 13, 2010 at 8:55 AM

hi. XenLogo.dll not supported in the 2.0 alpha is yet?

Jun 13, 2010 at 1:17 PM

No, I haven't updated XenLogo yet, so it's removed. Also avatars aren't working yet either.

DepthInstance shouldn't be included in the project. That's a mistake on my part. I'm not sure why velocityBillboard would be failing to build.
If you try opening the file, and saving it (so it's time stamp increases) then running the FX update it may be fixed.

The errors you were getting (device not creating) honestly sound like something was weird with your PC at the time. Sometimes these sorts of things happen.

Jun 13, 2010 at 9:17 PM

Removing DepthInstance from both projects and prebuild.bat, changing the timestamp on the VelocityBillboard3D (and Tutorial3.CusomShader, it had the same error message as VelocityBillboard3D.fx.cs) running FX Update and then re-running prebuild did the trick.  Strange issue... I suppose it might have been using the old custom tool to compile the shaders the first time, then because the timestamps matched it didn't try to compile them again with the new tool?  Well, it's working for me now, anyway, so I'll have a play with it.

Jun 13, 2010 at 10:58 PM

Cool. That's good to hear.

There aren't a huge number of new features to play with, the majority of the work has been reworking the shader system. The integration of animation and instancing into shaders is probably the biggest change on the surface.

Behind the scenes things are improved quite a bit.

Jun 14, 2010 at 3:46 AM

I tried to use Material Shader's fog property. it's cool. I really wanted it.

and question, how to apply fog to all model in entire scene? is there only way that create ModelShaderProvider to all model ?

Jun 14, 2010 at 9:57 AM
Edited Jun 14, 2010 at 9:59 AM

If all your models are using MaterialShader, then you can use MaterialFogStateFlag as a draw flag to force them all to use a specific fogging state. Same for textures & lighting.

using (state.DrawFlags.Push(new MaterialFogStateFlag( ... fogstate ..))
{
   ..draw scene..
}

I still have some things to do, to make it easier to change textures, etc. But for the most part MaterialShader is locked down.

Jun 15, 2010 at 1:23 AM

DrawFlags is cool. works fine. thanks you.

Jun 19, 2010 at 12:21 PM

I'm getting a glitch in tutorial 26 with Xen 2.0 on the PC.    When the tutorial starts up, the spritefont is glitched... all letters show up as black boxes the size of their kerning rectangles.

When you hit a key to start the tutorial, the letters of the "Press F12 for debug graphs" correct themselves and display fine.

It's not a critical issue to me, and perhaps you already expect that behaviour since 2.0 is very early in development, but I figured I'd mention it since it doesn't seem to be happening in the other tutorials.

 

Jun 19, 2010 at 1:56 PM
Edited Jun 20, 2010 at 6:05 PM

Yup, I'm aware of that :-) It's an internal state tracking screw-up. The first shader you bind isn't correctly told to apply all changes, so it doesn't apply textures correctly.

Otherwise, how are you finding it?
Have you had any issues with the shader compiler?