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)

0
votes
0answers
118 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
264 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
153 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
201 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
267 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
116 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
102 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
109 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
375 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
177 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
130 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
171 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
390 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
348 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
387 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
80 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
74 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
403 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 ...
4
votes
1answer
888 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
643 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
638 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); ...
1
vote
1answer
1k 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 ...
-2
votes
1answer
234 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 ...
4
votes
1answer
228 views

How can I handle the combination of multiple shader effects?

To be able to work efficiently with effects, is there a good way to combine multiple reusable "base" effects to achieve a more complex final result? For example, say I have an effect that handles ...
2
votes
0answers
208 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. ...
3
votes
2answers
191 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 ...
1
vote
2answers
179 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
1answer
315 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
240 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 ...
0
votes
1answer
262 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 ...
-1
votes
3answers
255 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
0answers
244 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
172 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
1answer
846 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
1answer
182 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 ...
-4
votes
1answer
135 views

My 2d Shader in XNA falls apart the second I put it into Farseer [closed]

I wrote a simple light shader that I tested in a simple 2d spaceship shooter and it worked fine. Once I imported it into my friend's farseer project with rotatable shapes, it doesn't seem to work ...
3
votes
1answer
140 views

Switching to a vertex shader

TL;DR I need to switch from a vertex array passed to the pixel shader with a real vertex shader approach. In my prototype, the terrain is procedurally generated and I have the following result: ...
4
votes
2answers
315 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 ...
4
votes
1answer
219 views

Premultiplied Alpha And Alpha Testing

I have a shader that is supposed to work with either alpha blending or alpha testing, but the color values being passed in are premultiplied alpha values. Is there an easy/standard way to have it ...
3
votes
1answer
428 views

Matrix in constant buffer on the GPU contains NaNs but not on the CPU

I've got a shader with the following constant buffer: cbuffer ShaderParameters { matrix inverseViewProjectionMatrix; float4 cameraPosition; }; When using Visual Studio 2012's graphic ...
5
votes
3answers
980 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 ...
3
votes
1answer
160 views

Messed up UVs in Unity3D for Android

All of my quads appear correctly textured on the Unity3D editor, a Motorola Xoom Android tablet, and on an iPad 2: But on our Samsung Galaxy Mini 2 smartphone they kinda look like this: I wrote ...
3
votes
0answers
736 views

Loading custom shader in Monogame [closed]

I have been trying to load this custom FX file into a Monogame project, and everything I try fails. (code taken from http://www.david-gouveia.com/scrolling-textures-with-zoom-and-rotation/) sampler ...
0
votes
1answer
143 views

Strange rendering in Direct3D 10 [closed]

I'm writing an application which renders graphics on the screen. The application can switch between Direct3D9 and Direct3D10 graphics modules (I wrote DLLs that wrap both D3D9 and D3D10). When trying ...
12
votes
3answers
726 views

How can I replicate the color limitations of the NES with an HLSL pixel shader?

So since 256 color mode is depreciated and no longer supported under Direct3D mode, I got the idea to use a pixel shader instead to simulate the NES palette of all possible colors so that fading ...