3
votes
0answers
79 views

HLSL - Voxel texturing

I'm currently trying to develop a Voxel Engine using Direct3D 9 and C++. To keep the memory usage low, i'm only passing the position, the orientation and the offset of the current voxels texture in ...
34
votes
1answer
2k views

How AAA games use this texture in the tone-mapping shader?

I found that Battlefield 3 as well as Saint's Row the Third use this texture in their final tone-mapping stage. Can anyone share a link to an article about how this texture is used? UPDATE: As ...
0
votes
1answer
58 views

Using tex2Dlod to determine the appropriate size of the texture

We have a top-down game with fixed camera position. We also use orthographic projection so every model in the game will always be viewed from the very same angle and from the very same distance. The ...
2
votes
1answer
106 views

What's the difference between Textures and VertexTextures in XNA?

The GraphicsDevice class of XNA has the properties Textures and VertexTextures. What is the exact difference? I don't really understand what MSDN tells me about this. I usually use Effect parameters ...
3
votes
0answers
102 views

Rasterization Rules and States

This thread directly concerns lightmap generation; however, indirectly, the rasterization of polygons by the GPU. I am currently generating lightmaps using a pixel shader. To the shader I send 3 ...
2
votes
2answers
146 views

XNA hlsl tex2D() only reads 3 channels from normal maps and specular maps

Our engine uses deferred rendering and at the main draw phase gathers plenty of data from the objects it draws. In order to save on tex2D calls, we packed our objects' specular maps with all sorts of ...
1
vote
1answer
161 views

HLSL Textured Light: outputs only a specific part of the texture (new problem)

Problem 1 I am trying to create a spotlight that instead of giving the circle within the spotlight a simple color, applies a texture to it. However, where the texture is supposed to be is only a ...
0
votes
0answers
56 views

XNA HLSL no model textures

I am using XNA and HLSL to render all the models in my game, so far there is only one, a flashlight. My flashlight model is a .fbx file type, and it loads the model in the game perfectly fine. ...
2
votes
2answers
141 views

Are global shader variables slower than texture look ups?

I want to send quite a bit of data to the GPU, the data will never change (or will change very rarely) after it has been created. Is there a performance impact to using global shader variables or ...
2
votes
1answer
89 views

Why is it when I render a basic cube, my editor's grid changes too?

I have one HLSL file for DirectX11 that only has input layout for color and position. Then another HLSL file for the simple cube that has position, normal and textures. What I noticed is when I render ...
1
vote
2answers
160 views

HLSL Multitexturing with more than 4 textures

I've come up with an idea that should work in multitexturing a terrain with more than 4 textures, up to a 64 if a supported ShaderModel is used. I'm trying to use the RGBA color values as both values ...
0
votes
0answers
213 views

HLSL Triplanar texturing and multi texturing performance

I'm stuck for my terrain rendering shader code for DX9. I'm looking to implement triplanar texturing, a texture atlas, and blending between different textures. Right now it's working. The problem is ...
1
vote
1answer
253 views

MultiTexturing by neighbouring points textures

Visual example: I've been trying to understand multitexturing for a while now, I've created a terrain generator but have no need for height just yet and I still want one texture to blend over to ...
1
vote
1answer
190 views

Confusion on HLSL Samplers. Can I Set Samplers Inside Functions?

I'm trying to create a system where I can instance a quad to the screen, however I've run into a problem. Like I said, I'm trying to instance the quad, so I'm trying to use the same geometry several ...
0
votes
1answer
117 views

how to create texture for modelmesh?

Is there a possibiltiy to create a texture from a meshpart in xna. By getting a flat version of the mesh. So I can create a texture for it and edit that texture(via rendertarget)? I need to get the ...
4
votes
2answers
336 views

Is it possible in HLSL to use bitfields?

I have in memory a representation of my 2d GameMap (think of a Scorched Earth like landscape). The map is made up of MapElements, a MapElement is made up of 64 bits defined like struct MapElement { ...
2
votes
1answer
427 views

tiled map - changing textures? (XNA HLSL)

I have successfully created a tiled map of various textures. Right now, i had a Vector4 in my own custom Vertex declaration deciding what texture each of the tiles should be. This is working ...
2
votes
1answer
2k views

Why can't I add a float4 read from a Texture2D.Sample in the Vertex Shader

These lines work (compile fine): float4 offset = HeightMap.Sample(HeightSampler, input.Texcoord); input.Position.xyzw += float4(0, 1, 0, 0); These do not (any use of offset together with ...
8
votes
3answers
1k views

Very slow direct3D texture sampling

So I'm writing a small game using Direct3D 9 and I'm using multitexturing for the terrain. All I'm doing is sampling 3 textures and a blend map and getting the overall color from the three textures ...