Answer Questions
Wolfgang Kamir How do I load a 3d mesh (.x file)?
How do I load a .x mesh into my scene The space game seems to use its own format (which it names .swm), and there's nothing in the help. I've been scanning through through the classes in the Framework namespace, but I can't see anything obvious! Is .x the recommended format for objects like this (If not, I change my question to be about the recommended format :D) If anyone knows anywhere that has some nice .x meshes I can play with, that'd be cool too. The only one I have lying around is a chair, and that's going to look a bit funny running around my game :D Danny Tuppeny wrote: I don't mind using the meshes from the space game, but aren't they all flat/2D No they are all very n ...Show All
soconne .x mesh file loading spend too much time, any solutions?
I built a very complex model, with almost 600'000 faces, after I optimized it, remains 90'000 faces, and I converted to .x file, whether binary or ascii format, the loading takes too much time, almost 40 seconds, but the other software like deep exploration, open it in a flash time, is there any solution to improve the loading speed Thanks. D3DXLoadMeshFromX( strPath, D3DXMESH_MANAGED, pd3dDevice, &pAdjacencyBuffer, &pMtrlBuffer, NULL, &m_dwNumMaterials, &m_pMesh ) that's my loading code, #- -, i'm confused. Generating adjacency is a very time consuming operation. You can't compare your performance with another application if you're ...Show All
ruckazz DrawUserPrimitives
Can someone explain why this method uses generics graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, 12, nonIndexedCube); I am a VB.NET business programmer and I am familiar with generics, but pretty much only use the generic collections. This seems silly to me. With generic collections, I define a collection to be of a certain type, and then where I use it, it is typed, keeping me from doing something stupid and saving me some extra coding. Since the 'definition', <VertexPositionColor>, is right next to the usage, actually in the same method call, I don't see that being the case. What does this give me or is it a performance thing It p ...Show All
Pockey Buttons not waiting for release
I'm making a Tetris clone in XNA GSE and I'm having trouble with the controls. I've created the pieces and got them to animate using the Animation tutorial in the docs, but when I hook the animation to button pushes, they spin wildly until the button is released. What I want them to do is turn once when the button is pushed and wait until the button is released and pushed again to turn again. I know I'm missing something but I can't think what it is. Here's my UpdateGamePad() method which is called from Game.Update(): private void UpdateGamePad() { gamePad = GamePad.GetState(PlayerIndex.One); if (gamePad.Buttons.A == ButtonState.Pressed) { CurrentFrame++; if (CurrentFrame > 3) CurrentFrame -= 4; ...Show All
AndyL Rendering a D3D Device in a Panel within a Form
Hi All - I'm writing a simple application using Visual C# and have a Form with several Panel controls on it. I would like to render to some of the panels to provide multiple 3D views of models etc. I have successfully created a Device that is rendering to the desired panel correctly, but I notice when I resize the application window my D3D panel is "Flashing". It looks like it is rendering the background color of the Form then rendering. I notice if I set the Device to rending in a single Form (not within a panel on a form) I don't see the flashing problem. But of course I would like to render to the panel for my design. Any suggestions 1. If you're using the simplest implementation, ...Show All
M.AmjaD The HLSL Workshop from the SDK
I have worked with shaders before, but not very much. I want to delve into shader development, and thought the HLSL Workshop to be a good starting point. However, I don't know how to actually get the tutorial FX files to run. Here's what I've tried so far: Opening the FX files in the DirectX Viewer. The viewer wasn't able to load any of the files, and gave this error for each: "- Global parameter not found. Effect is not SAS-compliant." Making the BasicHLSL solution ( mentioned in the HLSL Workshop docs as a tutorial for debugging shaders ) use the tutorial FX files, and loading the skullocc.x file instead of Tiny. This cause a lot of runtime errors to be thrown when setting the values for the effect object. I'm sure th ...Show All
KaiserSozeTR Windowed Resolution don't work
Hi, i have a functionality to Toggle Between Video Resolution, just as GraphicDeviceManager.ToggleFullScreen() method but changing the video resolution in Windowed or FullScreen mode. /// <summary> Alterna entre el tamano de ventana por defecto y el tamano minimo establecido </summary> public void ToggleVideoResolution() { if (currentResolution == SupportedResolution .Res640x480) { currentResolution = SupportedResolution .Res800x600; PreferredBackBufferWidth = DefaultWith; PreferredBackBufferHeight = DefaultHeight; } else if (currentResolution == SupportedResolution .Res800x600) { currentResoluti ...Show All
Suckafish Differences between Texture2D.FromFile() & Content.Load<Texture2D>
Hello, I'm a new XNA and C# programmer and wondered if someone could explain to me the difference between using Texture2D.FromFile() or Content.Load<Texture2D> to load texture resources into an application Is there a benefit to using one approach over the other I looked into the XNA documentation but couldn't find any documentation the really differnetiated between the two approaches Thanks in advance for any insight, Kevin i doubt you'll notice any gain in performance for using the content manager or the fromfile() however, if you don't use the content manager... then you are going to have to keep track of how content gets loaded on your own... ie "hmm do i use the content ma ...Show All
Drksrvnt How to use this code into my another code?
How to put this code using System ; using System . Diagnostics ; using System . Runtime . InteropServices ; namespace DirectShowLib . Test { public class IBasicAudioTest { IFilterGraph2 graphBuilder = null ; IBaseFilter filter = null ; IBasicAudio audio = null ; public IBasicAudioTest () { } public void DoTests () { try { // We need a stereo sound renderer... BuildGraph ( "foo.avi" , out this . graphBuilder , out this . filter ); this . audio = ( IBasicAudio ) this . filter ; TestBalance (); TestVolume (); } finally { Marshal . ReleaseComObject ( this . filter ); Marshal . ReleaseComObject ( this . graphBuild ...Show All
CPPUSer7 XBox 360 shader compatibility?
As the XNA framework will be PC <-> XBox 360 I'd like to know what shaders are supported by the XBox 360. Afaik the ATI Xenos GPU of the XBox 360 supports every shader even up to the coming shader model 4.0 (160 operations per cycle), is this correct As far as I'm aware the Xbox shader model is a superset of Windows shader 3.0. I could be wrong about some details, but it is certainly close to that. You can't run 3.0 Windows shaders directly on Xbox, though, because the output format is different. Xbox doesn't support the same token format as Windows, so it won't be able to handle the output of the Windows HLSL compiler. That means you need to compile your shaders twice: once for Windows targetting shader model 3.0, ...Show All
Bruce Baker Rocket Commander XNA Game
Hi everyone. I ported my famous Rocket Commander game (first .NET 2.0 game, free game with source code) to XNA and thanks to some multi-threaded optimizations it runs very good on the Xbox 360 too now. More information, the download links, screenshots and some notes about the porting process from MDX to XNA can be found on my blog: http://abi.exdream.com Rocket Commander XNA Screenshot: Ohh, I must have forgotten it in the hurry. Please Download the missing project here: XnaGraphicEngineContentProcessors.zip I've now included it into both source code downloads too, so if you download them now, you don't need the extra project. Thanks for the reply here, I didn't notice because on my test PC the directory XnaGraphicEngineCont ...Show All
Sanchit Bahal Why Can't Use Swap Chain in Full Screen Mode
When it calls CreateAdditionalSwapChain in Full Screen Mode, it's failed, while it works ok in window mode. "Note that any given device can support only one full-screen swap chain." means that you cannot have more than one full screen swap chain for a single device. Is that your case If not, consider my previous answer again. http://msdn.microsoft.com/library/en-us/directx9_c/Multihead.asp This is probably because the D3DPRESENT_PARAMETERS you're using contains invalid values for full screen swap chains like: - back buffer format - width and height - swap effect ... Consider using DirectX debug runtime during your development cycle. This will certainly point the problem out. Directl ...Show All
AnthoDesigns Terrain?
Anyone know a good way to make dynamic terrain and quickly at that I can read a black and white image file and read the grayscale and calculate a heightmap but it doesn't seem efficient to me or easily changable (if thats a word). :) Any help is always appreciated. Thanks! I would say its not really the resolution of the height of the terrain, but the resolution of the Z and X axis asuming Y is the world up. I use 1 unit between each vertice but the detail depends on a few factors, the units between each vertice on the Z and X axis being one of them. The position of the viewers eye location would matter because the closer you are to the terrain the more you will ...Show All
djbjmb Highly Optimized 2D Drawing
With the trends in hardware today, would it be worth the effort to render groups of sprites to offscreen surfaces For instance, we have an gui window composed of 9 sprites (All stored in 1 image, and will be rendered in a batch). 5 Of these sprites will every need scaled or tiled to draw the window every frame. Assuming that during the gui windows lifetime it's size and appearance will remain relatively constant, we can render it to an offscreen surface. This would allow us to minimize the scaling and vertex buffer operations to a single blit in future redrawings of the window. Or is it best to constantly push new quads to the GPU for processing like the Spritebatch object currently does The constant pushing of quads would only requir ...Show All
FCode GSE RTM on Vista RTM (unsupported)
i know it's not supported ... but has anybody got it to work bought the club account on the 360 and downloaded the app on the 360. installed Express on Vista with no problems and registered. tried an update, but didn't see any service packs. then i installed GSE, which complained about the VS projects, but it still seemed to install. fired up Express and the XBox 360 Starter kit project was there and built fine. went to tools options, and setup the connection to the 360. then i set the 360 to listening mode. but when i try to deploy, it just comes back and says make sure the the 360 is listening. also, turned off the vista firewall but got the same results. any ideas Thanks, casey Is yo ...Show All
