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
307 views

How to achieve animated glow

I am trying to achieve something I've seen numerous times, but I don't know where to start from. I've come across numerous old effects, which I can't recreate. The said effects are the glow animations ...
4
votes
1answer
789 views

Shadow mapping does not work correctly using GLSL shaders

I'm a beginner in shadow mapping. I have in my scene two meshes : a cube and a floor. The scene is lighted by a single point light. Here's for the following display the light properties : ...
0
votes
2answers
307 views

Help on my glow shader!

I'm trying to create a glow shader for a neon style game but I'm having a little trouble with rendertargets. Right now all I want is something VERY simple where I change the rendertarget, draw to it ...
0
votes
2answers
259 views

Which code is faster to convert -1 to 0 and 1 to 1?

I'm writing a shader for rendering the sides of triangles with different colors. I have a value mediump float back = dot(V, N) which is positive if the normal faces away from the camera and negative ...
9
votes
2answers
1k views

Large vertex buffer vs multiple draw calls

I'm just getting started with OpenGL, and I'm attempting to use it to create a 2D game. In this game, I have a hexagonal grid made up of a very large variety of differently-colored hexagons. As a ...
2
votes
2answers
142 views

Replacing 4 additive sprite layers with a single shader. Just can't get it right

I'm using directx9 and have 4 textures I want to draw on top of each other. if I do this: PDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); ...
0
votes
2answers
333 views

HLSL's Tex2D for GLSL?

I am trying to port a HLSL shader to GLSL. I'm just not quite sure how to convert this line: outA += Input.Color.a * tex2D(s, Input.TexCoord.xy + float2(-4.0 * pxSz.x * blurSize,0)).a * 0.05; ...
3
votes
1answer
652 views

How do I create a manual object with colors for each vertex?

How do I create a shaded manual object with colours for each vertex? Eg if ogreObj is the Ogre::ManualObject : ogreObj->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST); ...
2
votes
0answers
252 views

Monogame working with Krypton

I am trying to make a simple 2D game engine using Monogame and the Krypton 2.0 lighting engine. So far I have succeeded in rendering a light but I am unable to generate any shadows from any hull's. ...
2
votes
1answer
198 views

Hemispherical Projection

I'm trying to implement a radiosity processor. I'm aware of many places online to find information about radiosity. I found a great source on NVidia's website is GPU Gems - Chapter 39 . On this page ...
1
vote
1answer
132 views

XNA Strange Lighting, Shader

Hey guys, i have strange lighting problem. I've written my own "deferred lighting" shader and this happend: Pic: Normal-Map Pic: Light-Map As long as i only use one big mesh everything seems ...
1
vote
0answers
87 views

How do I align textures properly with an exploding sprite / breakable body?

I'm working on a game based on Box2D and Starling which includes breakable bodies - bodies/objects that when hit with sufficient force break apart (into smaller pieces). I've managed the physics part ...
0
votes
2answers
960 views

Draw wireframe overlay of model in GLSL

I have a 3D model that has a GLSL script, and I want to draw a line on each border of its polygons in the fragment shader. What should I do? Note: I am using Ogre3D, so I can't use OpenGL's ...
3
votes
0answers
417 views

Jet engine exhaust shader [closed]

How would I create a jet engine exhaust effect, as shown in the image from Fzero GX below. GLSL and OpenGL examples/solutions are prefered, though other resources are also welcome. Requirements ...
12
votes
3answers
778 views

Recreating this flat-shaded look

I'll keep it short. How does one achieve the effect depicted in the image below? Is it feasible to do in realtime? It looks deceptively simple, but it probably isn't. Are there any keywords I can ...
2
votes
0answers
78 views

Transparency behaviour on PowerVR

I'm doing some graphics optimizing tests, especially on PowerVR transparency. Now I made a scene where there are two groups of simple objects. One group has the shape in geometry using diffuse shader ...
2
votes
1answer
131 views

The math behind Variance Shadow Maps - moments

I am not asking how to implement them (that's not particularly difficult), but I'm having a bit of trouble understanding why the moments used in Chebyshev's inequality (indirectly) are equal to the ...
3
votes
2answers
72 views

Local shape color blending

I am trying to implement this in Unity 4 Pro. But I am stuck in the blending part. I don't understand how you could blend multiples textures/colors using multiples volumes on an object. How could you ...
0
votes
1answer
211 views

Creating a fragment shader to darken a white texture over time - OpenGL GLSL

So as a part of learning OpenGL, I've now decided to try and be a bit more creative with shaders, as part of a practice game I'm making using C/OpenGL. I'm completely new when it comes to working ...
3
votes
1answer
137 views

How to categorize textures into atlases

I am going to use texture atlasing for the first time in my games, and at first it seemed like a great idea to split textures into atlases by categorizing them by terrain themes e.g ForestTextures, ...
2
votes
2answers
376 views

How do I rotate a single object in HLSL?

I have a World with a 3D model of a head in it and that World rotates, like such: protected override void Update(GameTime gameTime) { //other stuff angle += 0.00005f; //more other stuff ...
0
votes
0answers
64 views

XNA HLSL no model textures

I am using XNA and HLSL to render all the models in my game, so far there is only one, a flashlight. My flashlight model is a .fbx file type, and it loads the model in the game perfectly fine. ...
3
votes
1answer
216 views

Outlining external edges on a complex shape made of cubes?

A gallery of my problem can be found here. I had to do it this way as it won't let me post more than 2 links due to my reputation. I'm trying to use 3D cubes to generate an isometric cube world. I ...
0
votes
1answer
135 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
-1
votes
1answer
124 views

Smooth Ramp to zonal harmonics

I have written in blitz3D some code to generate arbitrary 2D lighting lookup textures and I'm looking for a way to compress them. The idea is that they look rather smooth and low frequency, there must ...
3
votes
1answer
266 views

Directional light shader not behaving as expected

I coded my first glsl shader which manage diffuse and specular effects of a directional light. This is the fragment shader. #version 120 //matrix uniform mat4 model_matrix; //directional light ...
7
votes
2answers
5k views

GLSL Shader - Change Hue/Saturation/Brightness

I'm trying to change the hue of an image using a GLSL fragment shader. I want to achieve something similar to Photoshop's Hue/Saturation Adjustment layer. In the following image you can see what I've ...
1
vote
0answers
136 views

Matrix array doesn't seem to get populated

I'm trying to stream an array of matrices to a vertex shader, but it seems that only the first matrix works. What could be the problem? I suspect that I upload the matrices in a wrong way. C# ...
2
votes
1answer
3k views

How to create HDR and bloom in Unity3D?

Unity3D's reference describes the HDR Bloom as: Using HDR allows for much more control in post processing. LDR bloom has an unfortunate side effect of blurring many areas of a scene even if ...
1
vote
1answer
333 views

Which coordinate space is the canonical default for each shader pipeline stage?

I'm working with Direct3D 11 and HLSL. I use four different shaders (vertex, hull, domain and pixel). I always have troubles using the right coordinate space in my shaders. Could somebody identify ...
-1
votes
1answer
342 views

Using Shader causes triangle to disappear

The following is my rendering code. Private Sub GameRender() GL.Clear(ClearBufferMask.ColorBufferBit + ClearBufferMask.DepthBufferBit) GL.ClearColor(Color.SkyBlue) ...
2
votes
0answers
262 views

How to create heat haze effect in Libgdx?

I would like to create a heat haze effect for a 2D game I am making. Do You have ideas or suggestions, how to get that effect. I am using Libgdx(OpenGL 2.0). Thank You in advance!
1
vote
0answers
581 views

TEXCOORD0 vs COLOR in a Cg shader

I started to learn Cg shader programming, following the Panda3d shader tutorials. Having a scene with only a cube shown, each vertex of the model with a different color, I can successfully use the ...
4
votes
2answers
332 views

Calculate mipmap level in a loop with varying iteration?

How can I calculate the correct mipmap level in a shader? It needs to be used in a loop which runs a variable number of times so the compiler will not allow me to use Sample or the derivative ...
1
vote
2answers
250 views

LWJGL - If I use VBOs what can I do about separate textures?

So basically this is my problem: I am creating a game that needs a texture for each object. Now I would use a sprite sheet but the textures are different sizes. I am using VBOs and I need to some how ...
2
votes
0answers
313 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...
1
vote
0answers
1k views

Multiple Render Targets, Multiple Fragment Shaders

I render a normal and a depth image of a scene. Then I want to reuse these two images to do further texture/image processing in a second fragment shader. I use a framebuffer with 3 textures attached ...
1
vote
2answers
668 views

XNA HLSL Shader Glow

I have googled this to death, and I still don't quite understand it. I'm trying to create a glow effect in XNA using HLSL. A long time ago I was able to do it the way most people suggest which is by ...
4
votes
1answer
366 views

Matcap and BRDF Shading

I just would like to know what's the difference between the Matcap shaders used in ZBrush for example and the Bidirectional Radiance Distribution Function shader. Are there two techniques the same ? ...
3
votes
1answer
165 views

When are HLSL literals taken as a float and integer?

float2 uv = float2(fX % 1, fY % 1) * 1/16; In the above example 1/16 is treated as a float, multiplying the float2 by 0.0625, but in: float2 uv = float2(fX % 1, fY % 1) * 1/16 + float2(1/16,0); ...
2
votes
2answers
165 views

Are global shader variables slower than texture look ups?

I want to send quite a bit of data to the GPU, the data will never change (or will change very rarely) after it has been created. Is there a performance impact to using global shader variables or ...
0
votes
1answer
76 views

Vertex and Fragment Shader worldNormal

How to access/calculate worldNormal in a Vertex and Fragment shader ? Thanks a lot !
4
votes
2answers
279 views

Refractive blur in XNA?

I'm writing a 2D hack-and-slash game using XNA. I really want to implement the blur-like, refractive effect of a sword or such moving really quickly, seen in such games as Dust: An Elysian Tail and ...
0
votes
1answer
136 views

Angle to Vector3?

I am working on getting my directional lights to match the sun in my atmospheric scattering shader. I have a float that ranges from 0 to 6.28 (TwoPi). How would I calculate a vector3 from this angle? ...
2
votes
1answer
279 views

Odd blending result (semi-transparent 2d quad over 3D scene)

I'm working on a GUI library for my game, and I'm having problems with my blending. I have a 3D scene, which I render with glDrawArrays. In the fragment shader the alpha color is hardcoded 1.0f ...
0
votes
1answer
257 views

DirectX 11, using Tessellation & Geometry shader in a single pass

Before all, sorry for my poor english ! With DirectX 11, i'm trying to create a random map full with GPU. Using Hull shader stage, I'm managing LOD with tessellation. Using Domain shader stage, I'm ...
0
votes
1answer
128 views

Per-fragment lighting system behaves like ambient lighting system

This is the relevant section of my fragment shader varying vec3 normal; varying vec3 halfv; ... vec4 color = ambient * gl_LightSource[0].ambient; vec3 n = normalize(normal); float ...
0
votes
3answers
406 views

Using different shaders on the same model at runtime

I've already asked similar but a bit unclear question here but this time I will be very specific and to the point. Suppose I have an actor which grabs a power up. He starts to glow using bloom shader ...
9
votes
1answer
1k views

Engine Rendering pipeline : Making shaders generic

I am trying to make a 2D game engine using OpenGL ES 2.0 (iOS for now). I've written Application layer in Objective C and a separate self contained RendererGLES20 in C++. No GL specific call is made ...
2
votes
1answer
186 views

Shader Variable Types

I have a simple question. what are the meaning of : half4 myHalf; myHalf.yyyy; myHalf.xxzz; // or myHalf.yw Thanks a lot !