Answer Questions
Snickel65 Alpha Level Question?
Hi all, Below is my programming, ======================= renderer.Device.RenderState.SourceBlend = Blend.SourceAlpha; renderer.Device.RenderState.DestinationBlend = Blend.DestinationAlpha; renderer.Device.RenderState.AlphaBlendEnable = true; ======================= i can use this code set my material Alpha. How to set Alpha level For Example, iwant set alpha 70%. Best Regards, That is not the proper way actually. Frame buffer alpha blending is done with this formula: Final Color = ObjectColor * SourceBlendFactor + PixelColor * DestinationBlendFactor Blend.DestinationAlpha means read the alpha value from the existing pixel on the frame buffer, which is not the right option for setting material translucency. ...Show All
tlc660 I have already installed all the programs but I have a problem
Hi everybody I hope you could help me. I have already installed this software: MicrosoftR Visual C#R 2005 Express Edition XNA Game Studio Express and DirectX Software Development Kit (dxsdk_oct2006.exe) When I open a new Window Game (XNA) project, it has only the g raphics component , that's all right, but when I build and run the game it should work but it doesn't, I get the next error: Microsoft.Xna.Framework.Components.NoSuitableGraphicsDeviceException was unhandled Message="The values used in the attempt to create the GraphicsDevice were invalid." Source="Microsoft.Xna.Framework.Game" StackTrace: at Microsoft.Xna.Framework.Components.GraphicsComponent.CreateDevice(GraphicsD ...Show All
lushdog Image File Extension .dds
My problem surface, when I need to add image file, say texture1.dds to my game project. WindowsGame1 Add Existing Item... then from the dialog I select Files of type Image Files (*.gif,*.jpg,*.jpe,*.png,*.bmp,*.dib,*.tif,*.wmf,*.raw) So my problem is missing image file type *.dds . DX Tool creates it and is supported by XNA Texture2D.FromFile(). Is there published solution avaible or should I change with hexeditor for example *.jpe (never seen jpeg files with this extension) to *.dds If I hard code extension, then where lives dialog recource Any comments will do Peca Sorry, but drag&drop don't work. If you look "File Name" property, you see only pure file name without pat ...Show All
chaza Direct3D Textures
I am unable to create a Texture from a bitmap, but everything else works correctly. The same code works perfectly in Visual Studio 2003. DX3D = New Device(0, DeviceType.Hardware, MainForm.picDrawArea, CreateFlags.SoftwareVertexProcessing, PP) GetTexture = New Texture(DX3D, bmp, Usage.SoftwareProcessing, Pool.Default) These assemblies should be fine. Can you describe the exact error a little bit more I was wrong about Streams in VBExpress. There is no documentation in VBexpress or Framework 2.0, but all the Stream Classes exist. However, they don't work either. The bitmap is created from a file: Dim bmp As Bitmap = New Bitma ...Show All
WinFormsUser13232 Are they bugs?
Hy! I'm trin' XNA since 1.0 was released, so I'm kind of newbe. The first thing, what I expected as a bug is that SynchronizeWithVerticalRetrace seems to do nothing. I use the base Windows Game project for test, and in the Initialize function I set some parameters: _graphics.GraphicsDevice.PresentationParameters.FullScreenRefreshRateInHz = 70; _graphics.SynchronizeWithVerticalRetrace = true; _graphics.IsFullScreen = true; But it do nothing. The problem is: I can turn on/off VSyns, but I can't handle the refreh rate! I set it to 60, then to 70, but in fullscreen, my application runs with 85Hz -> 85 FPS instead of 60 or 70. Addition to this, my app throw an error, and Express must be restarted... The second is with multi ...Show All
psylencio mesh.BoundingSphere and mesh.ParentBone.Transform -- Scale?
I exported a model from 3ds max, but I can't get the bounding volumes to line up with the model. XNA 3D Tutorial 1 shows using the mesh.ParentBone.Transform property as the world matrix. When I do this, the model is accurately oriented, but it's scale is more than double it's original scale. The model is larger than the radius of mesh.BoundingVolume indiciates. I tried to render with an identity world matrix and the model is the correct scale! Unfortunately, it's coordinate system is like Max's with the XY plane lying flat and the Z axis running up and down. I may be missing something totally obvious (it is 4am) but why is the bone's Transform scaling Thanks! If you see a 2.54 overscaling in ...Show All
BaluMunugoti Adjusting the Gamma Ramp
Hi, I'm currently wondering how to set the gamma ramps with XNA. This is a function I wrote to do it: Protected Sub SetGamma( ByVal red As Single , ByVal green As Single , ByVal blue As Single ) ' Get graphics device. Dim graphicsDevice As GraphicsDevice = graphics.GraphicsDevice ' Get gamma ramp from device. Dim gammaRamp As GammaRamp = graphicsDevice.GetGammaRamp(0) ' Adjust values of RPG components. Dim redValues As Short () = gammaRamp.GetRed() Dim greenValues As Short () = gammaRamp.GetGreen() Dim blueValues As Short () = gammaRamp.GetBlue() For index As Integer = Byte .MinValue To Byte .MaxValue redValues(index) *= red greenValues(index) ...Show All
tweetys Debugger hanging at program start (Loader lock related?)
I'm developing a C# MDX application. Sometimes (maybe 1 out of 5 times) when I debug the application (by pressing F5) it hangs before displaying the main window. I'm sure it's happening before DirectX gets setup, but I'm not sure where - because the debugger hangs too. I notice that if I press F10 (step in) followed by F5 (run) the problem never happens and I also notice that it happens more often on slower computers than faster ones. I'm guessing it's a race condition, and it has something to do with the Loader Lock exception that I disabled in order to use MDX. Putting the following code at the very beginning of Main seems to reduce the probability of the problem occurring (but it still happens): ...Show All
TheAmigo Is the Keyboard class in the 360 xna framework useable?
I was using the object browser in C# express and noticed that the Keyboard class was present for the xbox360 (C:\Program Files\Microsoft XNA\XNA Game Studio Express\v1.0\References\Xbox360\Microsoft.Xna.Framework.dll ) assembly. Under the Microsoft.xna.framework.input namespace. So I was wondering is this by mistake If I plug in a usb keyboard into the 360 can my app/game make use of it (I don't have creators club yet to test it) Yes. It works fine... except that on my compact Cherry keyboard, Left-Ctrl, which I was using for shooting, is not recognised (and maybe some other keys - haven't tried all of 'em). Stuff like arrow keys, spacebar etc work great. Handy for quick testing when you don't want to ...Show All
enric vives Where is my fragment linker?
Unless I missed it (I looked as hard as I could) it doesn't look like the D3DX fragment linker (which also had a MDX version, mind you) made it into XNA. This confuses me greatly because anything serious with HLSL and any shader model requires support for run-time linking of shader fragments for performance. The only other options are: 1) Flow control instructions, which come with a very large instruction count and performance hit, especially in pixel shaders, and they aren't available in shader models 1.1 or 2.0. It makes very little sense to waste dozens of instructions on every pixel for something that stays exactly the same for all pixels in the same batch. And no, not even static flow control is available in PS2.0. 2) Co ...Show All
willthiswork89 combine c++ and c#
Hi everybody, I wish to know, if it's possible to combine c++ and c#. I mean, if I create a DirectX device using c++, could I draw it in a c# window. I'm not so confortable with c# and I 'd like to develop a 3D modeler based on c++ with an c# interface (I suppose the easiest way to create fancy user interface). Thanks for your help Ok Thanks a lot mate Ok , thanks a lot but what is the greatest solution to keep speed advantage from c++ I guess, it's to make a c++ dll (last solutions ) Am I wrong You can develelop you code in C++ and then expose it to C# as library using managed C++. Otherwise you can make you C++ code to be ActiveX ...Show All
Ayooya Anti-Piracy Security
I have this scary feeling that people are going to eventually figure out how to use XNA Game Studio Express to right code that will take advantage of the 360 hardware and allow booting of pirated(non-stamped and signed) games. What steps has MS taken to avoid this And if or when this happens will the "rights" and options open to the amauter devs be limited(Limited library uses or such) I really am looking foward to developing for my beloved 360 but I don't want anyone to ruin the fun. Hi Molex. Indeed, it is important that we protect games from being pirated. Beyond that we can't comment further about this issue. aL Well you are sort of correct One of the mod teams found a way to use flash the DVD-RO ...Show All
Michael Weed My first game... Asteroid Defense.
In this game you are a ship protecting a planet from incoming asteroids. Controls: 360 controller: Left Joystick -- Move ship left and right. A -- Shoot Right or Left Trigger -- Change Weapon. Keyboard Left and Right Arrow Keys -- Move ship left and right. Up and Down Arrow Keys -- Change Weapon Space -- Shoot The weapon you are using is shown in the top left corner. The stronger the weapon you use, the less points you get for destroying an asteroid. Levels progress at timed intervals and more and more asteroids come down. You lose when one of them reaches the planet. Screenshot: http://www.rocketsoft.gm-school.uni.cc/uploads/ADScreen.JPG Game File: http://www.rocketsoft.gm-school.uni.cc/uploads/AsteroidDefense1.1.rar All in ...Show All
fgarzonhz Rotating an entity problems - (Not camera)
Hi, I'm trying to create a rotate(float pitch,float yaw,float roll) function for my entity class, (The camera one works fine) but despite it working sort of, the model locks up at certain angles(I.e becomes very stiff and hard to rotate, like gimble lock but worse) Here's the function in question [code] public void Rotate( Vector3 Rotation) { Matrix m1 = Matrix .CreateRotationX( MathHelper .ToRadians(Rotation.X)); Matrix m2 = Matrix .CreateRotationY( MathHelper .ToRadians(Rotation.Y)); Matrix m3 = Matrix .CreateRotationZ( MathHelper .ToRadians(Rotation.Z)); LocalRotation = m2 * m3 * m1; Update(); } [/code] I've tried every order possible, doesn't make any differenc ...Show All
robinjam Any way to fill texture with data in memory?
I thought it should be Texture2D.SetData() but when I saw the remarks, I found it says it can only be used with dynamic texture. So if I use the constructor of Texture2D to create a managed/automatic texture, how can I fill it with data Wow, the Device object is missing almost all the methods I used to work around limitations like that in Managed DirectX... If you use the Texture2D constructor, it looks like you will have to specify that the usage is dynamic and the management mode is manual in order to get or set its data. The usage mode has some performance considerations with it, but they are unavoidable if you are generating the texture each frame. The manual managment mode just means you need to ...Show All
