a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered
1
vote
2answers
74 views
In the Direct3D 9 Effect API, how do you find the texture variable linked to a sampler?
In Direct3D 9 effect files you can write a sampler state that specifies a texture variable to use, like
Texture2D g_texSkyDome;
SamplerState g_samplerSkyDome
{
Texture = <g_texSkyDome>;
...
3
votes
0answers
104 views
+50
Optimizing performance of a heavy fragment shader
I need help optimizing the following set of shaders:
Vertex:
precision mediump float;
uniform vec2 rubyTextureSize;
attribute vec4 vPosition;
attribute vec2 a_TexCoordinate;
varying vec2 tc;
...
0
votes
0answers
32 views
Unity Shader GrabPass alternative
Is there an alternative for the heavy GrabPass method ?
Is there a solution to avoid the foreground issue ? I mean when using GrabPass, if the refracted object is in front of the bumpy refractor, he ...
3
votes
1answer
68 views
What is a Fragment Pipe?
I remember someone saying "24 fragment pipes on nVidia 7800" in a presentation.
Am I correct in saying that a fragment is the data that can generate a pixel in the frame buffer? Or are fragments the ...
3
votes
2answers
225 views
2D water shader similar to Limbo's effect
I'm wondering how I would go about creating a 2D water shader that is seen in this video http://www.youtube.com/watch?v=phChFfi4GOs
The water effect that limbo uses is pretty awesome. I'm not so ...
0
votes
2answers
169 views
2D Water Shader
I am trying to build a 2D Water shader and I am using Unity but the plateform isn't a problem.
Here is an example of what I am trying to reproduce :
Limbo water shader
Are there any good tutorial or ...
2
votes
1answer
524 views
Blur shader without render textures?
Is it possible to append a blur shader to a standard (diffuse) shader ? I am looking for a way to do this as Unity indie doesn't allow render textures.
0
votes
0answers
80 views
How can I fix dark banding artifacts when I turn on SSAO? [closed]
When enabling SSAO on my object ( in grey on the picture, background in green), sometimes, claimed in position of the camera, dark bands appear on my object (see picture).
The shader is written in ...
-1
votes
1answer
24 views
Shader applied to Texture is not showed in GLSLES
I'm trying to learn the basic of shaders following basic tutorials in Ogre.
I use GLSL ES 2.0 #version 100
I think I have a basic concept problem. I'm trying to render a model + texture without make ...
1
vote
1answer
400 views
how to modify shadow mapping in “3D Graphics with XNA Game Studio 4.0”?
So I've been following the tutorials from the book Sean James's "3D Graphics with XNA Game Studio 4.0", and have been doing fine until i reached the shadow mapping part.
in this book it creates point ...
2
votes
2answers
581 views
Multiple render targets and gamma correctness in Direct3D9
Let's say in a deferred renderer when building your G-Buffer you're going to render texture color, normals, depth and whatever else to your multiple render targets at once.
Now if you want to have a ...
3
votes
0answers
53 views
Multipass shaders and switching between passes
As mentioned here Effects should be avoided in DX11. If I understand correctly, that includes techniques and passes defined in *.FX files. So when doing a multipass shader (like the always-mentioned ...
0
votes
0answers
49 views
NVIDIA FX Composer 2.5 not updating time in preview
I started testing shaders today and got a problem with
FX Composer.
When I download Shaders from the Shader Library it compiles them fine and
I get a preview which applies the material to the object, ...
0
votes
0answers
32 views
DX11 Tessellation LOD with diameter incorrect when Object gets rotated by D3DXMatrixRotationYawPitchRoll [closed]
First of all, I'm using Microsoft Visual Studio 2010.
I implemented the LoD with diameter from following withpaper NVidia TerrainTessellation WhitePaper. In Chapter "Hull Shader:Tessellation LOD" ...
1
vote
1answer
81 views
Texture Shaders vs. Pixel/Fragment Shaders?
My question is a simple one.
Functionally, practically, and performance-wise, what are the differences between using a D3DX Texture Shader, and using a Pixel/Fragment Shader rendered with a full ...
-2
votes
1answer
56 views
Does it matter where I initialize Directx11's shader constant buffer?
Should I initialize it before Map(), before Unmap() does it make no difference?
-1
votes
0answers
47 views
XNA/HLSL cone shape 2D light
I'm new to HLSL and I'm trying to create a simple light for my 2D game. I made a point light and it looks great. However now I'm trying to create a cone shape light but I just don't know how. can ...
1
vote
2answers
93 views
State propagation in modern OpenGL
When last I dabbled in game development, I managed my geometry in a tree. Every node would call the render method on it's children, prior to resetting it's transformations, thus allowing the ...
3
votes
1answer
87 views
Do I need Texture Units when NOT using shaders?
Does calling glActiveTexture() even make sense when not using shaders?
I only have to switch the textures before drawing a buffer with glBindTexture(), right?
1
vote
1answer
49 views
I have a frag shader, one with an empty s_lightMap, how and why is it effecting the output?
I have an image of concrete rocks of different shades of colors, and I'm applying this shader, but without referencing s_lightMap's uniform in my program:
precision mediump float; ...
1
vote
0answers
122 views
GL_EXT_shadow_samplers killing my shader
I have the following fragment shader for my scene
#extension GL_EXT_shadow_samplers : require
...
vec4 color = texture2D(uTextureUnit0, varTexCoord0);
if (colorTransformEnabled != 0) {
vec3 ...
1
vote
1answer
110 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 ...
2
votes
1answer
144 views
Using Ogre particle point billboards with shaders
I'm learning about using Ogre particles and had some questions about how the point type particles work.
Q. I believe point type particles are implemented as a single position. Is one single vertex is ...
3
votes
2answers
93 views
Screen effects and antialiasing
I have been working on a game for a while using glut for basic window creation.
I was rendering to an offscreen buffer so that I could implement various effects like screen bulging, motion blur, ...
4
votes
1answer
145 views
How can I use shaders to make a square have a waving effect?
I'm new to using shaders to do some fancy effects and I'm struggling with them. I'm using DirectX 11 and HLSL. I have this square in the middle of the screen:
It's just a square that I've created ...
5
votes
1answer
1k views
gl_PointCoord always zero
I am trying to draw point sprites in OpenGL with a shader but gl_PointCoord is always zero.
Here is my code
Setup:
//Shader creation..(includes glBindAttribLocation(program, ATTRIB_P, "p");)
...
2
votes
0answers
45 views
OpenGL ES Single Bitplane Texture (or something close)
I'm looking to use a texture to store single bits (or a low number of bits, two or three). This in of itself isn't hard if you're using nearest neighbor sampling with some bit plane unpacking. The ...
3
votes
1answer
208 views
Does Unity's “Transparent Bumped Specular” translate to “semi-shiny must be semi-transparent”?
Unity's documentation for the "Transparent Bumped Specular" shader/material-type is simply a concatenation of each of the descriptions for its Transparent and Specular Shaders (and also Bumped, but ...
0
votes
1answer
54 views
Are there shaders or at least shader like things in Swing?
Is there? Because I'm wondering if it supports GLSL, HLSL, or it's own shading language? I don't know much about Swing graphics. Does anyone know?
1
vote
1answer
84 views
“lerp” returning value (Shader)?
I don't understand the lerp example in this code :
if(dot(WorldNormalVector(IN, o.Normal), _SnowDirection.xyz)>=lerp(1,-1,_Snow))
o.Albedo = _SnowColor.rgb;
else
...
3
votes
1answer
130 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 ...
3
votes
2answers
183 views
Techniques for reducing terrain shader complexity
My terrain shader does quite a bit, but I don't know how to break it up in any way that will reduce my instruction count without removing key features of the terrain. It does the following:
...
3
votes
1answer
91 views
Multiple Textures in Shader?
I have this (pseudo) code:
unsigned int TextureLoc = glGetUniformLocation(programID, "objectTexture");
for(int i = 0; i < object->texturesCount; i++)
{
glActivateTexture(GL_TEXTURE0);
...
0
votes
1answer
149 views
How to do Triplanar Texturing
Ok maybe i'm missing something because its getting late and i've been programming now for about 72 hours straight (minus a nap or 2) ...
I'm trying to write a shader for unity that will apply ...
3
votes
2answers
138 views
Shaders and Performance
I'm coding my first Shader in my little game engine, and I have some questions about it's performance and common approaches.
Is the Shader code processed by the video card instead of the PC ...
9
votes
3answers
866 views
Pixel-perfect rendering to a rendertarget with a fullscreen quad
I have some trouble rendering a bunch of values to a rendertarget. The values never end up in the exact range I want them to. Basically I use a fullscreen quad and a pixel shader to render to my ...
-2
votes
1answer
66 views
Incorrect rotations using openGL GLM and shaders [closed]
The goal of my program is to display a simple colored triangle rotating on the Y axis without any translation. I'm using the GLM library. The problem is that the transformations of my triangle are not ...
3
votes
0answers
99 views
Combining Effects
To be able to work efficiently with effects, isn't there a "good" way to combine multiple effects so that one effect handles stuff like "Multi texturing" and another controls the value like Ambient ...
1
vote
2answers
138 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 ...
1
vote
0answers
69 views
iPhone GLSL shader dynamic branching issue
I am trying to pass an array of vec3 as uniform and then iterate through them on each pixel. The size of array varies on situations so I can't make the loop with constant number of iterations. ...
4
votes
1answer
249 views
GLSL Editor and Debugger for MacOSX with ES2 support
is there a GLSL editor for the mac? I need it for iOS OpenGLES2 shader.
How do you best debug shader?
Regards
2
votes
1answer
118 views
Pixel Shader gradient problems
I have pretty much zero experience working with shaders as my first couple phone games were just 2d games that didn't use any sort of shaders. Now I'm working on a PC game that has a day and night ...
-1
votes
3answers
105 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 ...
0
votes
1answer
92 views
How to get a smooth dimming with SSAO?
I implemented SSAO in my game based on the tutorial at gamerendering.com. But the results I get are disappointing. Instead of a smooth effect as seen in the nvidia demos, my implementation causes ...
0
votes
0answers
99 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 ...
2
votes
1answer
119 views
How can I render the whole faces instead of only the vertices? [closed]
I'm doing my master thesis in comparing DX9 LoD with DX11 Tesselation LoD. Therefore I use a ShaderManager that calls either the shader for the DX9 implementation, where the model is exchanged by the ...
9
votes
3answers
852 views
Fastest way to render lines with AA, varying thickness in DirectX
So I'm doing some DirectX development, using SharpDX under .NET to be exact (but DirectX/C++ API solutions are applicable). I'm looking for the fastest way to render lines in an orthogonal projection ...
1
vote
1answer
102 views
OpenGL VBO Additional Attributes
If I have a buffer with my vertices, normals and texture coordinates, and I use glDrawArrays to draw the VBO to the screen, how can I send attributes per vertex that I placed in an array to the shader ...
8
votes
1answer
263 views
What is Ramp Shading or Lighting?
What is ramp shading or lighting and how does it work? Is it different than toon shading or is it the same concept? How is specularity calculated differently for ramp shading versus blinn-phong or ...
1
vote
0answers
104 views
Shaders Working in XNA but not Monogame Win8
Hey so I'm bringing a shader over from XNA to Win8. To test things I'm using josack's tutorial on pixel shaders:
http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html
I've got it running in my ...

