Answer Questions
kennm Determining if (part of) traingle passed depth buffer test/got rendered
My problem is simple, I want to draw an triangle (or anything for that matter) and then want to know, in the fastest possible way, if anything actually got rendered. I want to use this for a kind of portal engine. Basicly I want to draw part of a complex scene, with depth buffer enabled for read/write. Then I want to draw an transparent triangle (with depth buffer writing disabled), if part of this triangle is actually rendered (thus is within the viewing frustum and passes depth buffer test) I want to know this, so I know that which is behind it, is also visible. I need to do this several times per frame and want to keep my framerate up, so I want to do this as fast as possible. Does anybody has an idea how to do this ...Show All
leleu Camera Mouse-Look Algorithm
Hi, I'm writing a camera class and have gotten just about everything laid out. But for some reason, when doing the Mouse Look method (basic first person shooter look around), I get completely screwed results. The camera never seems to properly orient itself and something is very wrong. I've checked my algorithm a dozen times and I can't figure out what's wrong. If anyone can tell me, I'd appreciate it. Here are my MouseLook and Orthonormalize methods: public static void MouseLook(float x, float y) { // Rotation speed is always 0.001f and I've also substituted the Object's 'Up' and 'Right' Matrix xRot = Matrix.CreateFromAxisAngle(Vector3.Up, x * rotationSpeed); Matrix yRot = Matrix.CreateFromAxisAngle(V ...Show All
__murph__ Gamestate and GarbageCollection - basic question
Hi, I've read a few things about needing to load up all resources up front, and avoiding dynamic loading in order to keep performance up - if that's true I guess it applies to mid-game loading and not per-level loading I'm used to using various states to load up resources (e.g. models etc.) for a level, then play the level and when we trash the level (either quit/die/finish-level etc.) we trash the resources, then loop round and load up the next level's stuff etc.- is this way of working suitable using XNA Cheers :) Yes, I have a "Level" object that is fully serializeable. When it's time to load a new level, I deserialize the level from xml, and tell it to initialize, load...etc... I have a ...Show All
Tania-chan XNA with VertexBuffers only? (No loading content)
I'm trying to create just a simple test app that draws some triangles on the screen. I don't want to load any models, just use a VertexBuffer and IndexBuffer right now. I load the buffers and set them on the GraphicsDevice. When I call DrawIndexedPrimitives, I get the following error: "Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before draw operations may be performed." After some searching, I found a few people mentioning that your graphics driver must support vertex shader 2.0 and pixel shader 3.0. The card isn't all that old, but to be sure, I checked the GraphicCapabilities on the GraphicsDevice and both the vertex and pixel shaders are 3.0. So I don' ...Show All
adiash Managed DirectX Sprites: Is it possible to light them?
Hi, Does anyone know if it is possible to apply Direct3D lights to sprites constructed using the Sprite helper class in Managed DirectX Since the class creates a quad for the sprite, I would have thought it possible to light the quad or rather the quad's texture. I have tried adding a light to my sprite scene and have tried doing this both before and after drawing the sprites. However, I cannot seem to get the lights to work. I have used the following code: // This is in my initialise section: m_Direct3DDevice.RenderState.Lighting = true; m_Direct3DDevice.RenderState.ZBufferEnable = true; // This is in my render loop: m_Direct3DDevice.Clear(Microsoft.DirectX.Direct3D.ClearFlags.Target, Color.Black, 1.0f, 0); m_Direct3DDevice.BeginScene(); ...Show All
borice Could C# be the future of gaming?
Since XNA is using C#, and is is a more intuitive language than C++, is it possible that in the future that C# will dominate, espessially in AAA titles. Could XNA be ushering a new way of programming in the main stream Jim, You are correct, 20% is probably the worst I have seen. Unless you do some real thight loop memory operations. Most people never talk about poorly written code either, which is slow regardless of programming language. There is some horribly inefficent examples for every language out there. Having said that, I find it a lot harder to optimize c++ for performance, than c#. The guts is in the algorithms, if you get them right it should not really matter if you write your code managed c#. Roger Larsen ...Show All
treckamerica Should I use Object Oriented programming for games?
I am really confused whether or not to use object oriented programming for game development. I know that using classes correctly will help keep my code organized but I am confused about the performance. I have searched the web and I haven't got the exact answer.. not even close. Some people say, object construction and destruction (among others) is a performance degrader in OO programming (especially when it is repeated many times per frame). OO proponents say that it is not, if OO is used in the 'right way'. The problem is, I am not sure I know much about that 'Right Way'. So, can you please help me figure out what's best for my game Should I use classes or not Thanks! Trust me, go with OOP. The reason is that yo ...Show All
joey022461 XNA Article on GamesIndustry.biz
Clicky Sounds great Jim, thanks! ...Show All
3Nu Working with buffers in 2D
Hello all, I've been trying to figure out how the system with backbuffers work. In all examples I have found people are clearing the buffer before they draw something new. graphics.GraphicsDevice.Clear(Color.Black); ...draw some sprites... graphics.GraphicsDevice.Present(); I guess that when you enter the Draw method you are working with the backbuffer, so the clear() and the sprite draw() will affect the backbuffer. After that you call the Present() to draw the recently made backbuffer on the screen. My problem is that this is not how I would like to do it in my case. Everytime I enter the Draw() method I would only like to add some new things, and not clear anything. The easiest way to do this is to not have any backbuffer at all, but I ...Show All
WingingIT No Blue Channel?
Hi all: Thanks for all your help, my sky sphere now renders from the inside out, and thanks to www.thehazymind.com , I have a working camera to peer inside the sphere. I am stumped on something though. When I render a model that has texture maps with blue in it, such as the aformentioned skysphere, I don't seem to have a blue channel. The texture appears green instead. I'm stymied from the lack of help from the help files (of course they're beta). Any ideas Here's what I'm doing to render: //Get ready to draw the sky sphere graphics.GraphicsDevice.RenderState.DepthBufferEnable = false ; graphics.GraphicsDevice.RenderState.CullMode = CullMode .None; //Reset drawing states graphics.GraphicsDevice.RenderState.Alpha ...Show All
siyou Multiple Assemblies on the 360
It seems like from what I've read that the 360 will support running an XNA game with multiple assemblies created with C# (in fact the Game Library Project that comes with Game Studio Express creates a DLL). My question is, can any of these assemblies be created with other managed languages such as Managed C++ and still run on the 360 I know it will work on the PC, but I don't know if it will work on the 360. Thanks. If the languages create pure IL code, this might work but is not officially supported. If they use any native interop, or features such as Reflection.Emit that are not supported on the Xbox CLR, it won't work. Specifically, Visual Basic and Managed C++ code will no ...Show All
Sridhar_GRS XNA with other languages
Hello, my name is Brian i am an Indie developer looking into the XNA. My question is, will XNA ever be able to be used with VB.net and will microsoft allow it as a language to be used whilst creating Xbox 360 and Windows games than you. I have another question, the XNA is out there to make game development easier and also to fill in the gap between small time developers develping for the Xbox 360. But, with that said using the XNA would we be able to create RETAIL quality games for th Xbox 360, or are we limited to much smaller games such as..Geometry Wars i meant more like older first person shooters like...Quake1-3, Half-Life, and Adventure games. ...Show All
Sai A Blender
Can blender be used with XNA GSE Just wondering b4 i go and get my new comp this week because my desktop crashed... I wouldn't be so sure about that "no-support". Link Is there some where you could post some samples of you model so I can test them, I will try and simulate what you have posted about but the sample scenes you have will make sure we are using the same models. Thanks guys, my blender models are fine now :) Use it can, I have been using Blender for Modeling for a long while. But Blender should not be a decider in a new Computer, it will run on any of the modern PCs, even if the hardware dosn't sup ...Show All
GS80 Magenta sprite color comes up transparent?
This seems to be a new behavior in Beta 2, is it a feature or a bug When I draw a sprite with SpriteBlendMode .AlphaBlend that contans the color (255, 0, 255) that color shows up as transparent. Is this to allow an easier way to create transparent regions in your sprites Bill So how would you have wanted this to work, Lee I don't understand what you are saying here. You are complaining about a color being reserved for a special purpose, but then saying that you would never use pure magenta as a background color in any case. Also, please remember this is just the default behavior we are talking about here. The content pipeline is hugely customisable and can easily be modified to do this sort of thing in any way you ...Show All
Yongjun.Wu Problem using .FBX file
I have a model that I downloaded off of TurboSquid. I pulled it into 3DS MAX 9, and exported it as an FBX file. I added it to my project, and when I try to compile I get the following error: BasicMaterial has a texture, but geometry does not contain texture coordinates. Is this a problem with 3DS or GSE Any ideas on how to fix it Sorry to jump in but if you'd like to share the file with us please file a bug on Microsoft Connect where you can attach a file (Up to 2MB). You can find more information here: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=682921&SiteID=1 Thanks! Eli, You can E-mail me at mikepolzin(at)yahoo.com. Thanks for looking into this! Mike ...Show All
