Tagged Questions
0
votes
1answer
54 views
Resize a texture using the full SpriteBatch.Draw in XNA
I'm using the full Spritebatch.Draw function to draw my explosion sprite since I also need rotation. I am using the Scale value to resize my texture, but I can't get it to be accurate.
I want to be ...
0
votes
0answers
27 views
XNA 4.0 DepthStencil Buffer problem [closed]
I am trying to manage deferred rendering in my project. Esspecialy the skybox and clouds which has to be rendered behind everything and for sure the skybox+clouds will not be passed by deffered ...
-3
votes
2answers
393 views
How to preload a vast amount of models?
This is more a theoretical question,
during runtime, my game runs smooth without any hickups. But as standard game-objects, my game contains collectibles such as coins (which are rotating Models).
...
2
votes
1answer
87 views
Issues upscaling pixel art with SampleState.PointClamp
I'm developing a 2D game, and I'm striving to create a nice blocky low-res appearance for the game, yet allow it to be played at variable resolutions. So, I've researched resolution independency and ...
2
votes
1answer
165 views
Sketchup model renders wrong in XNA
My XNA model renders wrong.
It should render like that:
But it renders like that:
The background doesn't matter. It's just the model that renders wrong.
Here is the drawing code:
protected ...
1
vote
1answer
133 views
XNA 2D game fullscreen issue
Hello!
I am creating a 2D farming game using XNA - just today I have tried applying full screen to it, and I realized I failed badly with something. It cuts off a bit of the lower part [item hotbat ...
1
vote
1answer
196 views
Collision detection against specific sprite shape using XNA with Farseer Physics?
I am making a 2D XNA Game, using Farseer Physics for collisions.
I need collisions to be resolved against the actual shape of the sprite image, ignoring transparent pixels, rather than against the ...
0
votes
1answer
170 views
Custom VertexDeclaration for Color, Texture, Normal
What is the best way to create a VertexDeclaration, that makes it able to render a Shape consisting of vertices and also be able to store a color for the shape (in case the texture can't be rendered - ...
6
votes
3answers
584 views
What is the best way to render a 2d game map?
I know efficiency is key in game programming and I've had some experiences with rendering a "map" earlier but probably not in the best of ways.
For a 2D TopDown game: (simply render the ...
5
votes
2answers
629 views
How can I acheive a smooth 2D lighting effect?
I'm making a tile based game in XNA.
So currently my lightning looks like this:
How can I get it to look like this?
Instead of each block having its own tint, it has a smooth overlay.
I'm assuming ...
2
votes
2answers
166 views
Drawing multiple triangles at once isn't working
I'm trying to draw multiple triangles at once to make up a "shape". I have a class that has an array of VertexPositionColor, an array of Indexes (rendered by this Triangulation class):
...
8
votes
1answer
319 views
Drawing “Stenciled” Sprites and making them glow
Currently, in my game - I'm not using XNA's SpriteBatch to render anything(I am using Farseer Physic's Debug View), and I was wondering how I would render something like this:
only using XNA. My ...
2
votes
1answer
176 views
2D scene graph not transforming relative to parent
I am currently in the process of coding my own 2D Scene graph, which is basically a port of flash's render engine.
The problem I have right now is my rendering doesn't seem to be working properly. ...
4
votes
1answer
270 views
Vertex fog producing black artifacts
I am rendering a textured model using the XNA BasicEffect. When I enable fog, the model outline is still visible as many small black dots when it should be "in the fog". Why is this happening?
...
7
votes
1answer
466 views
Information about rendering, batches, the graphical card, performance etc. + XNA?
I know the title is a bit vague but it's hard to describe what I'm really looking for, but here goes.
When it comes to CPU rendering, performance is mostly easy to estimate and straightforward, but ...
0
votes
1answer
298 views
Isometric drawing “Not Tile Stuff” on isometric map?
So I got my isometric renderer working, it can draw diamond or jagged maps...Then I want to move on...How do I draw characters/objects on it in a optimal way?
What Im doing now, as one can imagine, ...
2
votes
2answers
163 views
Child parent rendering (flash) in XNA
i am currently in the process of implementing a render engine that works like flash's. Where a sprite is drawn inside another sprite and reflects all transformation (rotation, scale, etc) on the ...
2
votes
1answer
284 views
My transparent objects overwrite opaque objects depth and always draw on top?
I have set up an 'Order Independent Transparency' method for drawing my transparent objects.
The algorithm can be simplified as follows:
DrawOpaqueObjects()
DrawTransparentObjects()
Drawing the ...
3
votes
3answers
1k views
How many BasicEffects do you have in a Game? What is the best way to render multiple objects/shapes at once?
I'm trying to understand 3D rendering and it seems that everytime you render a new object (A 3D Cube or something) you need to have a new BasicEffect for each Box you render unless you want the exact ...
2
votes
2answers
327 views
How to manage drawing loop when changing render targets
I'm managing my game state by having a base GameScreen class with a Draw method.
I then have (basically) a stack of GameScreens that I render.
I render the bottom one first, as screens above might ...
1
vote
1answer
628 views
Why do 3d model drawn to a RenderTarget appear distorted compared to those drawn directly?
I've got a problem drawing a 3D model to a RenderTarget2D in XNA 4. When the model is drawn to a render target, and then the render target is later drawn to the screen it appears distorted. (See right ...
3
votes
2answers
715 views
Rendering a lot of Models at once with XNA
In an hexgrid based game, I render all terrain tiles as a separate model, reusing the same texture objects on all similar tiles. The tiles is a pretty simple model.
When the terrain is set to be at ...
0
votes
1answer
467 views
Abstracting entity caching in XNA
I am in a situation where I am writing a framework in XNA and there will be quite a lot of static (ish) content which wont render that often. Now I am trying to take the same sort of approach I would ...
1
vote
1answer
264 views
How do I make light objects in XNA?
Here's my dilemma : I want to have light sources placeable by the player, in terms of lanterns.
I know the best way to do this is to use pixel shaders, which I have done a lot of research and use ...
1
vote
1answer
693 views
Model not rendering correctly XNA
Basically i am trying to render a model yet it seems to draw polygons that should be behind something, in front of it. So i end up seeing some faces that should be behind something, totally covering ...
3
votes
1answer
483 views
“Clone” a RenderTarget2D?
I see that some XNA resources implement ICloneable (namely the Effect class) but textures don't. I have encountered a situation where I need to make a complete copy of a RenderTarget2D texture and use ...
1
vote
3answers
925 views
Rendering multiple RenderTargets to the screen
Let's say I have a background and a set of entities.
I have managed to draw the background into a Texture2D using a RenderTarget
I have also managed to draw all my entities into another RenderTarget
...
3
votes
1answer
394 views
Is there any equivalent to glPushMatrix in XNA?
I'm trying to implement a scene graph for my 2D game in XNA, and I was looking for a way to draw every object while saving only the local transformation of the object. This seems a bit like ...
3
votes
1answer
670 views
Drawing a depth map properly
I want to render a depth map by importing it from a file, then creating an array of vertices and indices, and then displaying it using a basic shader (just apply the view and projection matrices on it ...
2
votes
2answers
256 views
Are there any issues with not drawing to all render targets when using MRT?
Lets say I set 2 render targets:
device.SetRenderTargets(color, depth);
And then half my draw code only outputs color and not depth. This works fine on the PC and produces the expected results ...
10
votes
2answers
13k views
How Do I Do Alpha Transparency Properly In XNA 4.0?
Okay, I've read several articles, tutorials, and questions regarding this. Most point to the same technique which doesn't solve my problem. I need the ability to create semi-transparent sprites ...

