Search Forums
-
Read through your code and make sure that you're setting up the reflection matrix properly; is the reflection taking into account your camera angle?
Reimer's method is hard to get right, so how about trying a different method where you simply flip the whole world about the water plane then render that into a texture. You then project the ...
-
Implement radial blur using HLSL. Radial Blur is a lot like Gaussian Blur, except for each successive sample you magnify the image (by multiplying the texture coordinates).
Off the top of my head it's something like this...
sampler TextureSampler;float screenScale;
float3 RadialBlur(float2 centre, float2 texCoord){ float3 color = ...
-
Another way if you don't want to do things internally inside a class (which is probably the better way), is to check if the subclass is a specific type; something like this...
GameObject obj = GameObjects[i];if (obj is Ball){ (obj as Ball).Health = 10;}
Another way is to implement a Find() function that takes a generic type T that must extend ...
-
Why not store an 'effectiveness' value for each tower type for every unit type, then divide that effectiveness by the amount that the tower has been upgraded by (so e.g. a level 2 tower would be twice as good at destroying enemies so therefore that enemy is half as good at surviving that tower).
Loop over the board, summing up the ...
-
[quote user="jwatte"]if you use BeginRead()/EndRead() to do asynchronous I/O[/quote]
oops! Well you learn something new every day.. :S
Looks like you should be able to get away with having multiple content managers with one for each thread... as long as they don't all load in parallel.
-
You can change this by changing the Game.IsFixedTimeStep and Game.TargetElapsedTime in the Game() constructor.
To set the game to 30fps, do this in the game constructor:
this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 32);
-
All Content Managers do 'under the hood' is load the compiled .xnb files from the hard disk using the File System.
You will certainly have problems trying to read files from more than one thread since File IO is exclusive to a single thread so you'll get thread locking issues. For example if thread #1 is reading some content, and then ...
-
My method to prevent tunnelling is to check for collisions both at the ball position, and at ball + velocity. This won't catch some cases where the ball is moving really fast (you could another check at position + velocity*0.5f would fix that) but is probably good enough. (I suspect this is what you're already doing)
Here's some ...
-
That banding *might* be caused by 2 things:
1. the shadow depth map doesn't have enough accuracy (try using SurfaceFormat.Single, or look into splitting a float value into a 4 value color buffer)
2. the area that is being rendered by the shadow map is not being covered by the shadow map, which can lead to weird lines, spikes and other strange ...
-
[quote user="SpidieMan"]Do I need to code something that takes care of level of detail on these models? Or does XNA/DirectX take care of that itself[/quote]
The DirectX SDK has some samples on dynamic level of detail that allows you to simplify the models during runtime. It is in C++/DirectX though, but still worth a look.