Tagged Questions
0
votes
0answers
53 views
GLSL gl_ModelViewMatrix breaks my code?
So I have the following shaders which work (to the extent that they are completed anyway).
//Vertex Shader
uniform float offset;
void main()
{
gl_TexCoord[0].t = gl_MultiTexCoord0.t;
...
3
votes
1answer
151 views
variable number of lights in a glsl shader?
I want to render an arbitrary number of lights in my fragment shader. I do not understand how you can properly pass them into the shader though. For example, I want something like this:
uniform int ...
1
vote
1answer
126 views
Driver error when using multiple shaders
I'm using 3 different shaders:
a tessellation shader to use the tessellation feature of DirectX11 :)
a regular shader to show how it would look without tessellation
and a text shader to display ...
-1
votes
3answers
118 views
Directional light and matrix issues
I'm trying to implement basic directional lightning in OpenGL 3.3 by emulating the logic shown in this guide: http://www.arcsynthesis.org/gltut/Illumination/Tutorial%2009.html
I do not understand ...
4
votes
2answers
226 views
Geometry shader worldviewprojection
I'm writing a simple geometry shader to create 3D "primitives" in place of a single point. I am performing all of the world-view-projection conversions within the geometry shader after creating the ...
0
votes
1answer
94 views
Rendering an object more than once
Right now I'm facing the issue of rendering the same objects more than once in Directx 11, as the object has:
A diffuse shader
A directional lighting shader
A texture shader
Now the final color ...
0
votes
1answer
90 views
OpenGL RTT FrameBuffer question and Rendering to texture while sampling it
What i need to do:
Blur the selected texture and pass the texture to another effect for postprocessing.
Notice that i want one texture passed all over.
How do i want to do this:
Bind the FBO ( ...
2
votes
1answer
135 views
Shadow cubemapping?
I am working on a game with C++ and OpenGL 3.2. I have successfully implemented directional shadow maps and now I'd like to upgrade them to shadow cube maps (for point lights). I've done some Googling ...
3
votes
2answers
181 views
Which will be faster? Switching shaders or ignore that some cases don't need full code?
I have two types of 2d objects:
In first case (for about 70% of objects), I need that code in the shader:
float2 texCoord = input.TexCoord + textureCoord.xy
But in the second case I have to use:
...
9
votes
4answers
516 views
Avoid if statements in DirectX 10 shaders?
I have heard that if statements should be avoid in shaders, because both parts of the statements will be execute, and than the wrong will be dropped (which harms the performance).
It's still a ...
2
votes
0answers
239 views
Where is the Shader Designer?
I have VS2012 Ultimate and I've been trying to access (find) the Shader Designer. I searched through MSDN's text and Channel9's videos, but they keep failing to mention how to access it...
Can ...
3
votes
2answers
471 views
Learning OpenGL GLSL - VAO buffer problems?
I've just started digging through OpenGL and GLSL, and now stumbled on something I can't get my head around this one!? I've stepped back to loading a simple cube and using a simple shader on it, but ...
0
votes
1answer
148 views
Dynamically change shader syntax with the help of C++
I'm starting with the programmable pipeline and the shaders in C++ for OpenGL 3.0+, i would love to be able to change some settings on the fly, for example replacing a function with another function, ...
5
votes
1answer
424 views
Dealing with alpha for 2D per pixel lighting
Right now I've got a simple light shader. Every bitmap I draw goes through it to make up the scene. I only draw quads.
texture tex;
sampler2D s = sampler_state {
texture = <tex>;
...
5
votes
3answers
333 views
Finding out what pixel on the screen the fragment falls on
In my 2D game, I render tiles. I want to do lighting without needing an extra buffer the size of the screen.
Either in glsl or hlsl, what could I feed to the shader each time I render a bitmap so ...
1
vote
0answers
201 views
Full screen shader causes performance hit
I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting.
To do this, I create a new bitmap each time the display resizes that ...
0
votes
1answer
115 views
My blur gets ugly when radius too high
I have the following h and v blur:
Horz
texture tex;
sampler2D s = sampler_state {
texture = <tex>;
};
int tWidth;
int tHeight;
float blurSize = 9.0;
float4 ...
2
votes
2answers
539 views
My hlsl shader cannot unroll a loop?
I have this shader:
texture tex;
sampler2D s = sampler_state {
texture = <tex>;
};
int tWidth = 1;
int tHeight = 1;
int blurLength = 3;
float4 ps_main(VS_OUTPUT ...
1
vote
3answers
219 views
Shaders not linking correctly
I'm writing a rather simple "ShaderManager" which aids me with loading shaders in Open GL, altough I am having a few issues:
The shaders don't link correctly
The the attributes don't bind
Here's ...
2
votes
2answers
433 views
Lighting problems with Terrain
I'm in the process of learning Open GL and am having issues with lighting on my Terrian, I don't know if the issue is related to how I calculate my normals or the shader itself (I am using the shader ...
0
votes
1answer
480 views
Toon shader with Texture. Can this be optimized?
I am quite new to OpenGL, I have managed after long trial and error to integrate Nehe's Cel-Shading rendering with my Model loaders, and have them drawn using the Toon shade and outline AND their ...
6
votes
4answers
872 views
Spell Effects/Shaders
I want to be able to achieve spell effects that cause a fragmenting/discoloring effect on the sprite. The first couple seconds of this video http://www.youtube.com/watch?v=HNCFh7mkvuc shows what I ...
6
votes
2answers
794 views
Casting a shadow over a whole scene with GLSL in 2D?
I'm making a (non-isometric) side scrolling 2D game and I want each fragment that I draw to cast a small drop shadow when it is near another object. What sort of algorithms are used in fragment ...
4
votes
3answers
2k views
Loading and using an HLSL shader?
I've been looking everywhere and all I can find are tutorials on writing the shaders. None of them showed me how to incorporate them into my scene.
So essentially:
Given an hlsl shader, if I were to ...
1
vote
1answer
290 views
Output from vertex shader in D3D9
I've been looking at creating some 2D rendering systems in D3D9, basically because I don't like ID3DXSprite. For the output of the vertex shader, what co-ordinate system does the run-time expect ...
2
votes
1answer
246 views
Bluring behind something then drawing text?
I want to basically make a blur shader in glsl and use it like Windows 7 does for Windows. I want to for example draw something and then blur a rectangle, then draw text over it.
If someone could ...

