A proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API.
0
votes
1answer
47 views
HLSL How to flip geometry horizontally
I want to flip my asymmetric 3d model horizontally in the vertex shader alongside an arbitrary plane parallel to the YZ plane. This should switch everything for the model from the left hand side to ...
1
vote
0answers
33 views
Different ways to pass Textures into HLSL shaders
The GraphicsDevice class of xna 4 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 ...
1
vote
2answers
77 views
Computing pixel's screen position in a vertex shader: right or wrong?
I am building a deferred rendering engine and I have a question. The article I took the sample code from suggested computing screen position of the pixel as follows:
VertexShaderFunction()
{
...
...
7
votes
2answers
199 views
Fast lighting with multiple lights
How can I implement fast lighting with multiple lights?
I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level.
The problem is ...
0
votes
0answers
64 views
Projecting shadow map
I'm having a problem with shadow mapping and don't know where to go from here.
Take a look at this screenshot:
The cube circled in green is the light position, the light direction is pointed ...
2
votes
0answers
62 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 ...
1
vote
1answer
89 views
What does ddx (hlsl) actually do?
I'm a bit confused. The official documentation (http://msdn.microsoft.com/en-us/library/windows/desktop/bb509588(v=vs.85).aspx) says that ddx(input) is the partial derivative of the input with ...
0
votes
0answers
42 views
How to encode float3 into float2 and back again in HLSL?
Good afternoon,
I am looking to offload some 3D calculations to the GPU without raising my requirements to DX10. Specifically, I am generating densities in 64x64x64 3D blocks, which fit nicely into ...
0
votes
1answer
80 views
Storing few values in an int - small gain
This might be a bit hard-to-answer question, but... I had a DirectX::XMFLOAT3 as a vertex attribute. I have changed it to just an int by placing the 3 floats into int (using only 8 bits per float). In ...
0
votes
0answers
59 views
Shadow Mapping Wrong Results
Since 2 days, i'm trying to figure out whats wrong with my shadow shader.
The shadow map is drawn correctly, just the projection on to the scene is not working.
The Vertex Shader Code seems fine:
...
1
vote
1answer
112 views
Color grading, shaders and 3d textures
I'm trying to implement color correction with the 3d lookup table. The lookup table is actually just a 2d texture 256x16 and consists of 16 squares which one is 16x16.
When it comes to rendering, I ...
0
votes
2answers
61 views
HLSL's Tex2D for GLSL?
I am trying to port a HLSL shader to GLSL. I'm just not quite sure how to convert this line:
outA += Input.Color.a * tex2D(s, Input.TexCoord.xy + float2(-4.0 * pxSz.x * blurSize,0)).a * 0.05;
...
5
votes
1answer
110 views
What does HLSL's tex2D return at (0,0)?
I'm trying to understand the mapping of texels to pixels, especially in the context of pixel shaders. I already found out the following:
When I define a standard quad with vertices at integer ...
2
votes
1answer
72 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 ...
11
votes
1answer
186 views
Accounting for waves when doing planar reflections
I've been studying Nvidia's examples from the SDK, in particular the Island11 project and I've found something curious about a piece of HLSL code which corrects the reflections up and down depending ...