a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

learn more… | top users | synonyms (1)

3
votes
1answer
117 views

Surface normal to screen angle

I've been struggling to get this working. I simply wish to take a surface normal and convert it to a screen angle. As an example, assuming we're working with the highlighted surface on the sphere ...
3
votes
0answers
166 views

SSAO Distortion [closed]

I'm currently (attempting) to add SSAO to my engine, except it's...not really work, to say the least. I use a deferred renderer to render my scene. I have four render targets: Albedo, Light, Normal, ...
2
votes
1answer
613 views

Writing to a structured buffer with a compute shader (D3D11)

I have some problems writing to a structured buffer. First I create a structured buffer that is filled with float values beginning from 0 to 99. Afterwards a copy the structured buffer to a CPU ...
4
votes
1answer
609 views

Material System

I'm designing Material/Shader System (target API DX10+ and may be OpenGL3+, now only DX10). I know, there was a lot of topics about this, but i can't find what i need. I don't want to do some kind of ...
2
votes
1answer
91 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 ...
9
votes
1answer
3k views

Game Engine Design – Ubershader - Shader management design

I want to implement a flexible Ubershader system (with deferred shading). My current idea is to create shaders out of modules, which deal with certain features (FlatTexture, BumpTexture, Displacement ...
1
vote
1answer
176 views

3D Reflection - Drawing Upside Down

After reading up on rendering reflections, it seems that the way to do it is the render the scene from underneath the plane of reflection, and then use projective texturing to map the reflected ...
4
votes
1answer
420 views

How can I emulate point sprites in D3D11?

I have points which I pass to a vertex shader and then to a geometry shader, but now I want to get from the geometry shader a "bigger" point. So the point should get a "dadius" like it was possible in ...
1
vote
1answer
271 views

Workaround for reading and writing same texture?

To apply post effects, it is often needed to read the preliminary image, perform computations on its pixels and store the result in the same texture again. For example, think of a tone mapping or ...
0
votes
2answers
206 views

HLSL Pixel Shader Compile, Flow Control, Instruction Count, XNA Issue

im trying to find help with an issue im having moving from the XNA 3.1 framework to XNA 4.0. The shaders I wrote for my 2D game work fine in XNA 3.1, but wont even compile in 4.0. At first I got ...
1
vote
1answer
1k views

Volumetric Fog Shader - Camera Issue

I am trying to build an infinite fog shader. This fog is applied on a 3D plane. For the moment I have a Z-Depth Fog. And I encounter some issues. As you can see in the screenshot, there are two views. ...
2
votes
1answer
357 views

Fog shader camera problem

I have some difficulties with my vertex-fragment fog shader in Unity. I have a good visual result but the problem is that the gradient is based on the camera's position, it moves as the camera moves. ...
6
votes
2answers
595 views

What is this Super Mario shading technique (the edge glow) called?

What is this Super Mario shading technique (the edge glow) called? It can best be seen at the legs.
0
votes
0answers
314 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
275 views

Using a switch command in one shader vs multiple shaders

If you have multiple shaders, could you instead of switching between shaders all the time just have one shader with a switch and each case will send you along to another shader function which you ...
4
votes
3answers
379 views

What techniques make next gen look so realistic [closed]

I have watch several gameplays from upcoming titles for ps4 and xbox one and I must admit that they are breath taking. Of course with new hardware, models will have more polygons and higher texture ...
0
votes
1answer
192 views

Shader program compiles fine on Ati, fails on other vendors

Got a real annoying problem here. My shader program compiles fine on my Ati Radeon HD card, but on Nvidia and Intel it failes to compile. Vertex shader: #version 120 attribute vec3 in_position; ...
1
vote
2answers
2k views

What is the best method to update shader uniforms?

What is the most accepted way for keeping a shader's matrices up to date, and why? For example, at the moment I have a Shader class that stores the handles to the GLSL shader program & uniforms. ...
1
vote
1answer
221 views

Why does my blur shader implementation produce this strange result?

I tried to implement the blur shader shown here. Instead of having a simple 2D texture I use Unity's GrabPass function to capture what's behind the plane to have a transparent effect. Then I apply ...
2
votes
1answer
241 views

GLSL Multiple Uniform Structs

I'm developing a lighting system for my voxel game, and I have to send multiple (alot, say up to 200) lights to my shader program. Those lights contain the following data: Position (vec3) Color ...
2
votes
1answer
658 views

Simple Optimized Blur Shader

I have a vertex-fragment shader that use the Unity3D GrabPass functionality (it grabs the screen). And I apply my GrabPass to have a transparent effect. GrabPass { "_GrabTex" } sampler2D ...
3
votes
2answers
155 views

Opengl shader questions

I'm currently building a shader that takes a 2D texture sampler and uses UV coordinates to map it. This works fine for all textured objects. However, I'm having a bit of a problem as I'm trying to ...
2
votes
1answer
139 views

Manual GLU.gluUnproject

Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject. How can I calculate the picking ...
0
votes
1answer
262 views

Drawing a HUD above 3D with shaders in GL

In the old days you would just do glOrtho in Projection, reset Modelview-Matrix and draw in [-1,1],[-1,1],0. But now-a-days we have shaders and I wanted to avoid the use of matrices. My code so far: ...
12
votes
1answer
8k views

How do I create a cel-shaded cartoon look?

I am interested in everything related to this kind of effect (modeling, game engine, animation). What sort of stuff is needed? Here are some sample images of what I mean:
5
votes
2answers
716 views

What range of values can HLSL's tex2D function return?

When using the tex2d function in a HLSL shader, as so: float height = tex2D(heightMap, IN.texCoord).r; What range of values can be returned to the height variable? Is it always a number between ...
8
votes
1answer
567 views

2D Water top surface profile

I am trying to create the effect of the water surface thickness with a vertex-fragment shader. I am in a 3D game environment but It's a scroll view so a "2D" view. Here is a good tutorial of creating ...
0
votes
0answers
125 views

Depth Test not working properly on Nvidia

So, I send a Development Test of my in-dev game to some friends, and they found out that the Depth Test in OpenGL does not work on Nvidia. I use my own matrices and sent them to the shader, and at ...
2
votes
2answers
289 views

3D Distortion Effect

I'm trying to make a distortion effect similar to this: However I'm not making a 2d screen space effect. I'm applying it to a 3d scene and I want it to be placed IN the world, so it can be blocked ...
2
votes
1answer
160 views

OpenGL Calculate Matrices

Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix: public Matrix4f ...
0
votes
1answer
215 views

Get world-position in Vertex shader

I'm wondering how I can get the final position of a vertex. I use glTranslate in my render code, and I'm not getting the world-coordinates correct. My world is devided in chunks and my position get's ...
0
votes
1answer
281 views

GLSL Shaders-> How to manage?

As your game get's bigger and bigger, you will use more and more different shader effects. Let's take an easy example: I have clouds in my voxel-based world, and I want to give it a blue-ish tint ...
0
votes
1answer
127 views

Shader registers for different graphics card

The title is not very explicative, so i'll try to make myself clear. I have two "working"(on which i work on) PCs : a desktop that runs an NVIDIA GT440 an a laptop with a RADEON HD 4650. I have a ...
2
votes
1answer
106 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 ...
7
votes
1answer
1k views

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; ...
-1
votes
1answer
117 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 ...
0
votes
2answers
2k 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 ...
5
votes
1answer
417 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 ...
1
vote
1answer
185 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
138 views

Does it matter where I initialize Directx11's shader constant buffer?

Should I initialize it before Map() or before `Unmap()? Does it make a difference?
2
votes
2answers
174 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
118 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
74 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; ...
3
votes
2answers
426 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
2answers
372 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 ...
3
votes
2answers
3k 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 ...
1
vote
1answer
413 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 ...
2
votes
0answers
87 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 ...
0
votes
1answer
80 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
436 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 ...