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)

2
votes
1answer
54 views

How do I draw a circular portion of a texture within LibGDX using an OpenGL ES shader?

What is the simplest way to implement a shader to draw a circular portion of a full screen texture where the circle is dynamically resized as part of an animation using LibGDX? Is a shader even the ...
0
votes
0answers
15 views

Shader to mask image with polygon

I'm new to graphics programming and GLSL in particular. I'm working on a 2D game and the setup is as follows: There is an image on the screen (a sprite in the game engine [Cocos2d-x if it matters]) ...
0
votes
1answer
79 views

Pixel Shaders To Create Predator Effect

I am learning shaders, and I figured I would try to use them to create sort of a predator effect. I got to the point where I rendered my level to a rendertarget and passed that to the shader file, ...
1
vote
1answer
83 views

How to cast colored shadows

I have a glassy object and when light passes through it I want it to cast colored light behind it, instead of the shadow. I could just use another light object to cast that colored light, but is it ...
0
votes
0answers
23 views

Outline of plane slice of arbitrary object

How would you extract the outline of a shape from slicing a plane through an arbitrary object? Note: This is related to my Unity Answers question, but not exactly the same.
0
votes
0answers
30 views

MonoGame Shader - 2MGFX cant compile in SM4

am trying to compile three .fx custom shader files from a monogame sample project, i am tryting to get running for windows phone. The GaussianBlur.fx file is: // Pixel shader applies a one ...
1
vote
1answer
60 views

2D Hidden Object Silhouette Shader

Right now I am not using any depth information in my engine, but I just found out that it would be neat to be able to render the silhouette of important game objects that are "behind" something with a ...
0
votes
0answers
30 views

How do I use two or more shaders in the same object in unity

ok guys, so I have a basic ramp shader I copy from the unity shader cookbook. It's just a basic ramp shader. And then I got another shader I got from the unity shaders wiki, which is basically an ...
0
votes
1answer
22 views

FindNextValidTechnique fails

My effect file compiles successfully, but FindNextValidTechnique fails. Technique part of the shader: technique Diffuse { pass Pass0 { VertexShader = compile vs_2_0 ...
0
votes
0answers
51 views

Is Phong shading supposed to be so camera-angle dependent?

I'm not sure if I have a bug in my code or not. It seems like it's a bug, or at least a major shortfall. Here's two images of the same model at slightly different angles (by moving the camera): As ...
0
votes
0answers
37 views

Unity material is missing after compilation

I have a piece of code that signals the player that a projectile has hit its target. Everything works fine during the playmode, however after I compile it, it acts as if there was a missing material. ...
1
vote
0answers
32 views

Sprite outline based on light position in UE4

I have simple sprite (for example black box) and I like to add to it outline (red line on example image) but based on light direction. I know UE4 use deffered renderer, so I cant access to lights, but ...
1
vote
0answers
40 views

Glow shader limited by the texture area

I'm working on a glow shader (for 2D engine Futile relying on Unity). It works OK but the effect is limited by the texture area. Except from adding a lot of empty pixels around the textures (which ...
1
vote
0answers
58 views

Rushing river water [closed]

I am creating water in unity3d engine, I tried many shaders (flowmap,flow texture,etc) but I am not quite sure how to get the same effect displayed in the following img? http://imgur.com/KduUpaz
1
vote
1answer
92 views

OpenGL VBO and VAO Confusion

I would like to present here my Question about VBOs and VAOs. Basically from what i understand you can have different VAOs each of which can contain up to several VBOs , and by binding to the VAO's ID ...
3
votes
1answer
103 views

Geometry Shader not generating geometry for some Vertices

I am playing with a geometry shader and I am wondering why it doesn't generate geometry for each vertex in all meshes? I don't think this is a Cull problem because the same vertices generate ...
1
vote
1answer
66 views

Apply an special effect to an scene area

I have a 2D game where I have a second camera on my scene, that renders an upside down image of the scene, and distorts it, giving the effect of water reflection. I render this camera first, and on ...
2
votes
1answer
147 views

3d compute shaders in order access

I'm working on a compute shader for a 3d texture where I want to evaluate pixels in a specific order, is there any way to do this? let's say that I have made a texture using the following code; tex = ...
3
votes
1answer
87 views

How to generate a RGB * a texture for a glow effect in GLSL?

I would like to create a glow effect in GLSL, there is a tutorial that explains how we multiply RGB * a : I have some questions : is it an operation that is in a fragment shader, where RGBa is ...
1
vote
1answer
65 views

DirectX 11 vertex shader incorrectly sending <0, 0, 0> normal vector to pixel shader

I'm following the Rastertek tutorials. I'm unable to get diffuse lighting working from http://www.rastertek.com/dx11tut06.html. I think the NaNs in the following screenshots is just from stuff ...
0
votes
0answers
24 views

Can i use shaders in allegro without opengl?

I'm currently learning opengl but it seems quite complicated so i considered using some library like sdl or allegro. I noticed that allegro has some built in functions to create and attach shaders. ...
1
vote
0answers
33 views

Generate a large data structure using a compute shader

I know that RWTexture2D Result; void CSMain (uint3 id : SV_DispatchThreadID) { Result[id.xy] = float3(1,2,3); } will result in an texture containing the numbers 1,2,3 however I'm ...
2
votes
1answer
58 views

How to assign texture to shader?

In OpenGL, most shader uniform variables are easy, a float or a vec3 or whatever is associated with a shader program. But samplers are different, we associate a texture unit to the shader program, and ...
1
vote
0answers
25 views

postprocessing shader destroying viewport on linux?

Basically I implemented gamma correction into a q3 based game to get rid of the annoying SetDeviceGammaRamp. On windows and macosx everything works fine, but on linux it draws garbage. It looks like ...
-3
votes
3answers
149 views

Using a basic shader in libGDX

Looking at https://github.com/libgdx/libgdx/wiki/Shaders, I have decided to try these shaders: String vertexShader = "attribute vec4 a_position;\n"+ "uniform mat4 ...
0
votes
0answers
25 views

Textured/Vertex Colored Shader fallback

I have this simple ShaderLab shader that I use for particles, among other things (it's more complicated than this but I have omitted the unnecessary bits). When I do not specify a texture, it falls ...
0
votes
1answer
53 views

Unity shaders: best way of handling data structures

I'm working on a shader in Unity that uses a Binary Tree to store some precomputed values, this binary tree should be available to the shaders and would ideally also be constructed on the graphics ...
1
vote
1answer
75 views

Custom shadowmapping in Unity not working properly

To experiment with a certain technique, I'm implementing my own shadow mapping in Unity. I'm using a camera for the light "view", which is rendered to a RenderTexture after being post-processed with ...
2
votes
1answer
130 views

Why encode floats in RGBA?

Working on some effects that require depth (Z) data in Unity, I saw that these use a method to store the depth data encoded in the RGBA channels of a regular texture. half4 frag(v2f i) : SV_Target { ...
0
votes
0answers
30 views

unity pass texture from one camera to another for shader

I'm working on a system where I have to get a texture from one camera to another (render a -> render b) is there an easy way to do this? For a simplified example this would be used to get the ...
1
vote
1answer
116 views

Apply shader to only a part of a sprite

I'm trying to make an image blur when a transparent image overlays it, I am wanting it only to blur the section that is being overlayed. So if half of the original image is not being overlapped, that ...
0
votes
1answer
81 views

OpenGL Shader Storage Buffer Objects array length problem

Ok guys, I think I have a very strange problem. I have an old laptop, but its HD 6370M currently supports opengl 4.4, so i decided to learn how to use some new features of this platform, so after ...
0
votes
1answer
32 views

Second pass in multipass effect is ignoring

I am trying to render my vertecies in 2 passes, but seems I am doing something wrong, because only one pass applying. I cannot make the second one work despite that second pass is applying. Here is ...
0
votes
1answer
40 views

Wrong distance in Depth-buffer

I am currently trying to get the Depth Buffer as a texture to use it for edge detection algorithms. Since XNA4 does not allow direct access to the Depth Buffer as texture i have to render it into a ...
5
votes
1answer
237 views

unity 5 how to get a shadowmap

I'm writing a custom shader in unity 5 that requires a shadowmap (not just for drawing shadows but also for different computations involving scattering particles through fog). Does anybody know how to ...
0
votes
1answer
69 views

How to use a buffer in GLSL to do a LUT-lookup?

I am currently on a medical application which needs different kinds (up to totally individual) lookup tables (LUT) for image display. And this done with 10bit finish. So it is most of the time ...
0
votes
0answers
19 views

converting HSLS gives error

I'm using the following parser: https://github.com/unknownworlds/hlslparser I also have the following code: /* * Bo Sun, Columbia University, All rights reserved * ...
1
vote
1answer
107 views

Dot based light mask with shader on sprites

So I have a scene, completely based on 2D sprites. I want to render "light sources" into a seperate frame buffer (so mostly dots around, for example, the centre of a flame) and then render that frame ...
-2
votes
1answer
51 views

What's the difference between Rendering pipeline and compute shader?

What's the difference between rendering pipeline - https://msdn.microsoft.com/en-us/library/windows/desktop/ff476882.aspx and compute shader - ...
0
votes
0answers
27 views

Strange result, when changing variable name

I have no idea, what is going on. The mat4 xxx is the cause. Renaming it to "bones"/"bone_transfromations" etc. won't work it gives me an error. Renaming it to "test" works perfectly fine... This is ...
1
vote
2answers
95 views

HLSL Pixel Shader - Color depending on condition

I am new to shaders and HLSL so bare with me on this one. I have a 2D tile map in my game and want to create a mini-map, at first I was just copying all the data from one sprite batch to another and ...
0
votes
0answers
30 views

How to implement data structures for shaders

I'm currently researching computer graphics and esp. how to combine research and it's practical applications. To get started I wanted to implement the methods used by a few papers. First of which I ...
0
votes
0answers
42 views

Good system for experimenting with shaders in different languages

I'm trying to experiment a bit with shaders and they have been programmed in several different languages (GLSL, Cg and HLSL). Now most systems (dirrectX, openGL) have only support for one of them. ...
-3
votes
1answer
71 views

What's the difference between rendering and shaders?

What is rendering? What are shaders like vertex ,tessellation shaders etc? I am confused what's the difference between rendering and shaders? and how rendering is performed using shaders? Can we ...
0
votes
0answers
56 views

opengl shaders getting started problem

I'm following this tutorial for shading in opengl. However I wanted to start with another shader to make things more interesting So this gives me the following code: // Include standard headers ...
0
votes
0answers
13 views

C++ - Error X3501 Main Entrypoint Not Found [duplicate]

I was developing my DirectX 11 app, but when I wanted to add a function to draw a triangle, I get this error from compiler. Error X3501 Main Entrypoint Not Found This is how my main .cpp looks ...
1
vote
1answer
43 views

Pick which directional light shades which object

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first ...
0
votes
0answers
141 views

Most efficient way to achieve the following 2D heat wave background effect?

In Unity, what would be the most efficient way to achieve the following heat wave background effect Super Metroid - SNES (skip to 34m 5s for those on mobile) http://youtu.be/yB317FOcU0Y?t=34m5s ...
0
votes
0answers
69 views

DirectX Compute shader (HLSL) makes texture black

Hello this is my first question on this forum :) When using compute shader in directx to change the color to blue the texture only gets black. I really don't understand what the problem could be and I ...
3
votes
1answer
118 views

If-clause in GLSL

I read a few thing about, that in GLSL both sides of the if-clause is executed, so do you have any idea for a workaround for this one: uniform int uses_bones; uniform mat4[] bone_transformations; ...