a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered
9
votes
1answer
5k views
How can I create an efficient bloom shader with GLSL?
I have searched the net for resources related to rendering a bloom effect using GLSL, but haven't found anything. Although the tutorial at Philip Rideout's website is a good one, it performs very ...
3
votes
1answer
478 views
Why are my texture coordinates always (0,0) in this shader?
What I'm trying to do is add my depth buffers values to my scene, ie. I'm trying to make objects closer to the camera darker and objects further away lighter. Which should be easy: just render the ...
1
vote
1answer
104 views
How does one multiply by a constant in a VS1.1 assembly vertex shader?
I'd like to multiply a vector by -1
e.g.
mul r0, r0, -1
When I try this, I get this error message:
SimpleShaderA.vsh(20,17): error X2000: syntax error : unexpected integer '1l'
How can ...
5
votes
1answer
4k views
DirectX11, how do I manage and update multiple shader constant buffers?
Alright, I'm having a hard time grasping how constant buffers are bound to a pipeline stage and updated. I understand that DirectX11 can have up to 15 shader-constant buffers per stage and each buffer ...
4
votes
3answers
3k views
What happened to .fx files in D3D11?
It seems they completely ruined .fx file loading / parsing in D3D11.
In D3D9, loading an entire effect file was D3DXCreateEffectFromFile( .. ), and you got a ID3DXEffect9, which had great methods ...
3
votes
2answers
361 views
WebGL geometry calculations
I have a dynamic surface in WebGL, that is animated in vertex shader. I want other objects to interact with this surface (for example, an object riding on dynamic terrain). What's the best way to do ...
16
votes
1answer
764 views
What is the math behind the light effect in krakatoa?
I'd like to know the math behind the light effect in krakatoa (click here for an example).
Light source is traveling with particles, but how is shading done? Is it something simple, like Phong ...
2
votes
1answer
743 views
Does OGRE do hardware skinning by default?
I am trying to understand how OGRE works at a lower level, and from what I have read so far, I believe OGRE generates shaders from material scripts using its RTShader system, on the loading of each ...
6
votes
2answers
2k views
Using a GLSL fragment shader to draw a texture in the middle of a quad
I'm not sure how possible this is, but I'm trying to use a fragment shader to draw a portion of a texture in the middle of a quad. This is all 2D. The quads consist of four vertices from (0, 0) to ...
18
votes
3answers
4k views
For voxel rendering, what is more efficient: pre-made VBO or a geometry shader?
Given a fairly static voxel array, what is more efficient: using the CPU to pre-generate a VBO to render the voxel faces (ignoring more advanced forms of rendering like marching cubes for now) or ...
2
votes
2answers
856 views
Multiplatform GLSL shader validator?
Im working on a multiplatform (Pc,Mac,Linux) game that uses shaders quite extensively. Since we do not have any funding, it is pretty hard to test our game on all possible hardware configurations.
...
0
votes
1answer
565 views
How to not-unroll loops in Shader Model 3 HLSL
I'm working on raycaster in HLSL, unfortunately it have to be in DX9. But it cannot be compiled
I did similar raycaster in DX11 and i know that there is always problem with FXC compiler that it tries ...
1
vote
1answer
710 views
How do you make a water shader?
I'm working on a minecraft-like world and recently saw this video with a water shader. I searched but couldn't find any good info on how to do something similar. Maybe I'm just googling the wrong ...
5
votes
2answers
431 views
Which are the most futureproof languages for graphics (shader) programming?
I have written some GLSL and Cg shaders a couple years back. I am starting another graphics engine project and I want to choose my technologies carefully so that my code will be accessible years down ...
3
votes
1answer
700 views
How'd they do it: TF2 payload cart glow?
How did the creators of TF2 make the glow on the payload cart visible through walls? Is it possible to implement this in Unity's shaderlab?
35
votes
1answer
2k views
How can I reduce aliasing in my outline glow effect?
I'm trying to replicate the glowing outline effect in the Left 4 Dead game. The effect causes an objects outline to glow, even when the object is occluded. Here is a screenshot of the effect:
I'm ...
5
votes
3answers
592 views
Can anyone recommend a 3D model viewer with shading?
I am looking for a simple real-time OpenGL based render engine to show a 3D model on screen.
I prefer using 3DS Max's 'shader' materials (real-time materials) for editing.
Do you know any good ...
11
votes
3answers
474 views
Is there an alternative to decals that will let me put bullet holes on a complicated object?
I'm trying to figure out a way to do "bullet holes" but actually apply the texture at the shader level? If I'm dealing with a model which doesn't have a "flat" face I'd like to be able to wrap the ...
1
vote
1answer
548 views
XNA - multiple VertexBuffers?
I'm trying to learn how to use VertexBuffers in XNA 4.0. I can render wireframe shapes and I can render textured shapes. However, I'm having some trouble rendering them both at once.
I'm ...
1
vote
1answer
630 views
Multiple Render Targets not saving data
I originally posted this question on stack overflow, but realised it might be better here. The original question can be found here
I'm using SlimDX, targeting DirectX 11 with shader model 4. I have a ...
1
vote
1answer
767 views
How to properly set up XNA shader?
I'm trying to get a basic shader to work in XNA. I pass in a bool value called "TextureEnabled" to indicate whether or not it should expect some UV texture coordinates. But regardless of what I pass, ...
3
votes
0answers
704 views
Sampling from depth texture causes shader to stop working
I'm currently having issues with depth textures. When I sample from a depth texture it causes my other samplers to fail. For example, when I set gl_FragColor manually the depth buffer is correct. I ...
3
votes
1answer
384 views
Phone complains that identical GLSL struct definition differs in vert/frag programs
When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant / Android 2.2) complains that the definition differs.
struct Light {
mediump vec3 ...
2
votes
1answer
1k views
I cannot update a shader constant via a constant buffer in DirectX 11
I've tried everything I can think of, but I cannot get a constant buffer to update a variable in my shader in DirectX 11. I followed the examples on msdn. I read and re-read the articles on constant ...
2
votes
2answers
676 views
implementing multi pass rendering in a game engine
I have done multi pass rendering before and understand how it works. I did a simple example which rendered a basic scene with shadows. This was all done in one file. Now I am trying to figure out is ...
9
votes
1answer
315 views
How can I incorporate physics into a procedurally generated world from a geometry shader?
Essentially I want to remove the need for generating coherent noise from the CPU to the GPU. From there, I also want to generate the terrain for a three dimensional world using this noise as densities ...
5
votes
1answer
1k views
How to manage shaders?
I've done some shader programming some time ago but only simple stuff. I'm especially interested in how do you manage shaders? Do you just write one of each kind, or do you need more of them? If so, ...
6
votes
4answers
875 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 ...
3
votes
2answers
4k views
Can't update DirectX11 shader constant buffer [closed]
Alright, I'm currently making the transition from DirectX 10 to DirectX 11 (with very little help from the MSDN documention) and recently ran into a snag with updating a shader's constant buffer.
My ...
1
vote
2answers
826 views
Using a shader messes up my alpha in XNA
I'm making a 2D game that ends up being too dark on some laptops, so I figured I'd use a shader so people could brighten it up if need be. Unfortunately, once I got it in there nothing would fade in ...
4
votes
1answer
555 views
Shader effect similar to Metro 2033 gasmask
I was thinking about effects in games the other day and I was reminded of the Gasmask effect from Metro 2033. Once you put the gasmask on it blurred a bit in the corners and could ice up and even get ...
4
votes
2answers
810 views
Real time reflections
I just had a quick look at the new Crysis 2 DX11 update, and was quite surprised by some of the new features, especially the real time reflections on moving models. From what I could gather, there are ...
1
vote
0answers
465 views
How can I run the pixel shader effect?
Stated below is the code for my pixel shader which I am rendering after the vertex shader.
I have set the wordViewProjection matrix in my program but I don't know to set the progress variable i.e in ...
3
votes
1answer
704 views
Using raw vertex information for sprites rather than SpriteBatch in XNA
I have been wondering whether using SpriteBatch is the best option. Obviously for prototyping or small games it works well.
However, I've been wanting to apply techniques such as shaders and lighting ...
5
votes
1answer
266 views
How can I test shaders for nVidia on an ATi system?
I and our other devs have ATi graphics cards. However we have encountered that some shaders that compile without warnings on ATi don't compile at all on nVidia. The problems are trivial to fix, but ...
2
votes
1answer
372 views
Writing the correct value in the depth buffer when using ray-casting
I am doing a ray-casting in a 3d texture until I hit a correct value. I am doing the ray-casting in a cube and the cube corners are already in world coordinates so I don't have to multiply the ...
2
votes
1answer
712 views
Calculating vertex normals on the GPU
I have some height-map sampled on a regular grid stored in an array. Now, I want to use the normals on the sampled vertices for some smoothing algorithm. The way I'm currently doing it is as follows:
...
4
votes
3answers
2k views
How can I draw the depth value in GLSL?
I want to draw the depth buffer in the fragment shader, I do this:
Vertex shader:
varying vec4 position_;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
position_ = ...
6
votes
2answers
795 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 ...
1
vote
2answers
886 views
Pixel Shader Giving Black output
I am coding in C# using Windows Forms and the SlimDX API to show the effect of a pixel shader. When I am setting the pixel shader, I am getting a black output screen but if I am not using the pixel ...
4
votes
1answer
310 views
Direction vector in raycasting
When I read about how to get the direction vector in raycasting, for example on this site: http://www.daimi.au.dk/~trier/?page_id=98
They first render the mesh with front face culling and then with ...
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
685 views
How to make a custom semantics HLSL shader for the pixel shader
I'm pretty sure it's possible but i have no idea how.
Could anyone tell me how to make a custom semantic for a pixel shader.
Thanks
0
votes
1answer
125 views
How can I apply a shader to images in a map in XNA?
Basically, what I'm trying to do is apply a shader to my background image and only the background image. The problem is: the background is actually made up of tiles that are picked out of a list of ...
2
votes
1answer
2k views
OpenGLES 2.0: Rendering Multiple Sprites - Texel Corruption
I'm having a tremendous time getting the second (or additional) sprites in my game engine to render properly. The first one always works great: it is positioned and sized properly in screen coords, ...
3
votes
1answer
965 views
How to make a gaussian blur effect in UDK
I want to make a plane shape (surface) that have a gaussian blur applied to it and this plane is transperant, so all objects behind it looks like they are having a gaussian blur effect.
0
votes
2answers
1k views
OpenGL ES 2.0: Calculated Cube Vertex Normals Verification
Could I kindly ask to confirm, that the calculated normals are correct, please? I have calculated them on my own, but my testcube is still strangely lighted within OpenGLES 2.0.
The vertices were ...
9
votes
6answers
8k views
OpenGL ES 2.0: Repository of Quality Shaders
Could I kindly ask, to suggest me a repository of high quality OpenGL (OpenGL ES 2.0) vertex and fragment shaders, please?
I am looking for pixel based ligting shaders (such as phong) and simmilar. ...
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
2answers
644 views
Learning Shaders in XNA
I am trying to learn how to use Shaders for a 2D XNA project I am working on. To test them out, I was trying to make a white triangle become colored using a super simple Pixel Shader, and I can't get ...