0
votes
2answers
163 views

How to mix pixel colors in Shader?

I have a pixel that have a colour RGB. This color is calculated by the shader and can be anything. How can I override this color by a colour I choose. If my pixel is white it's simple, I can do this: ...
8
votes
3answers
519 views

How can I create a glitter effect?

I am trying to create a glittering effect for my realtime shader but I don't know how. Here is one example, and another example. What technique can I use to implement this?
1
vote
1answer
138 views

How does HLSL handle clip(vector)?

My goal is to convert clip() to GLSL, version 1.5. I'm currently doing a basic: if (x < 0) discard; But if x is not a scalar, obviously I can't use the "<" operator. So I'm wanting to ...
2
votes
1answer
244 views

Is this GLSL equivalent to this HLSL?

I was wondering if the both shader codes are equivalent. So the question is, is this GLSL vNormal = mat3(FUSEE_ITMV[0].xyz, FUSEE_ITMV[1].xyz, FUSEE_ITMV[2].xyz) * fuNormal; Equivalent to this ...
0
votes
2answers
170 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
2answers
62 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
70 views

Vertex and Fragment Shader worldNormal

How to access/calculate worldNormal in a Vertex and Fragment shader ? Thanks a lot !
2
votes
1answer
93 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 !
1
vote
1answer
786 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. ...
1
vote
1answer
571 views

Low-level GPU code and Shader Compilation

Bear with me, because I will raise several questions at once. I still feel, though, that overall this can be treated as one question that may be answered succinctly. I recently dove into solidifying ...
4
votes
2answers
520 views

Rain drops on screen

I am trying to make simple rain drop effect on screen.Something like this http://fc00.deviantart.net/fs20/f/2007/302/5/6/Rain_drops_by_rockraikar.png My idea is to: Create small drop shaped normal ...
5
votes
3answers
541 views

Finding out what pixel on the screen the fragment falls on

In my 2D game, I render tiles. I want to do lighting without needing an extra buffer the size of the screen. Either in glsl or hlsl, what could I feed to the shader each time I render a bitmap so ...
1
vote
0answers
240 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
1
vote
3answers
520 views

Writing a shader once without using CG?

Is there a tool that can convert a fragment shader from hlsl to glsl or glsl to hlsl? I do not want to use cg since it is not able to work on mobile platforms. Is there a tool that can make it so I ...
0
votes
1answer
679 views

CG/CGFX to GLSL

So, I'm making the painful move from my beloved XNA to OpenTK, and I'm stuck: Since I've got a LOT of existing shaders written in HLSL, NVidia's CG compiler seems like a natural way to minimize the ...
2
votes
1answer
497 views

Model in Blender GLSL to XNA HLSL

Is it possible to make model in Blender, with enabled GLSL, add multiple textures, etc, and then just load it in XNA, where's own HLSL? Will it work?
7
votes
4answers
462 views

What types of effects or shaders would you teach in a rendering class? [closed]

I am looking for a list of topics that would be fun to learn and not too complicated to implement with a prototyping tool like FX Composer or Rendermonkey for an intermediate class of real-time ...
36
votes
6answers
14k views

What are the pros and cons of HLSL vs GLSL vs cg? [closed]

What are the pros / cons of the three?