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

Shaders are recompiled on every uniform change

In my game I'm using shaders to change the color of objects depending on their health. I'm passing floats from my jME3 project to the shaders by using material.setFloat("UniformName", uniformValue). ...
1
vote
3answers
15 views

How to sample a texture with specified LOD in SM 2.0?

That is my question, in SM 3.0 there is the HLSL intrasic function tex2Dlod to pick a color on a texture2d at specified coords and specified level-of-detail. But after long search on the web, I don't ...
0
votes
0answers
5 views

Alpha Lambert Shader Transparent even when Alpha is 1?

So I'm writing a shader that has to be differently transparent in different spots. However, when I use #pragma surface surf Lambert alpha, the object is partially transparent even when I force alpha ...
0
votes
0answers
24 views

Phong shading blows out things close to white [OpenGL]; is there a way around this?

I'm doing per-pixel lighting using the Phong shading model. In pseudo code this looks like: vec4 ambientColor = light.ambientIntensity * material.diffuse; vec4 diffuseColor = light.diffuseIntensity ...
0
votes
0answers
3 views

Slick2d - apply shader

I have a problem. I'm trying to apply a shader to the whole screen. Since I haven't used shaders before I don't know how to pass the texture to the shader. Everything else works... So here are the ...
0
votes
1answer
20 views

How to set a struct as a Direct3D9 vertex shader constant?

I have a vs_2_0 shader like this: struct ConstantBuffer { float4 diffuse; float4 specular }; shared uniform ConstantBuffer g_cb : app_constantBuffer; void PS(out float4 Color: COLOR0) { ...
1
vote
0answers
70 views

why is my (from example) shader appearing as black?

I have the following (very simple) shader: #pragma kernel CSMain RWTexture2D<float4> Result; [numthreads(8,8,1)] void CSMain (uint3 id : SV_DispatchThreadID) { Result[id.xy] = ...
0
votes
1answer
79 views

Unity how to change material properties at runtime

I'm working on a unity game where I want to change the color of a material from within a script. The material applies to a line renderer. I currently have the following script: using UnityEngine; ...
0
votes
1answer
53 views

2d Vs 3d custom shaders

I am about to start teaching myself how to write custom shaders by following some online tutorials and resources, but I had some concerns regarding them. After analyzing the requirements needed for a ...
0
votes
0answers
39 views

Shader - Simple SSS lighting issue

I am trying to create a simple subsurface scattering effect using a shader but I am facing a small issue. Look at those screenshots. The three images represents three lighting states (above surface, ...
0
votes
0answers
11 views

Applying Image Effect to specific texture uploaded and not to both texture and background

Hi I was following this script and shader example for brightness, contrast and saturation. I was able to follow along by attaching the C# script to the main camera and the shader to the script object. ...
0
votes
1answer
85 views

Unity 5 - Texture/Material rendering issue

I am working on a Minesweeper clone that started as a Unity 4.6 project and ended up as a Unity 5 project. I have cube objects that use Legacy Shaders/Diffuse. I am new to Unity 5, so I am not fully ...
2
votes
0answers
49 views

How do you add turbulence to a particle system using noise?

I have implemented a basic particle system using transform feedback in openGL, hoping to replicate a dust cloud. I have looked at methods of adding turbulence, such as vortices found here. But they ...
0
votes
1answer
89 views

Shader - Color blending

I would like to know how to blend colors in a specific way. Let's imagine that I have a color (A) and an other color (B). I would like to blend them in such a way that if I choose white for the (B) ...
1
vote
0answers
47 views

Multi-layered tilemap

I need to be able to efficiently render a tilemap which can be constructed this way: There is one non-transparent base layer Then there can be 3 partially-transparent layers on top of it. Each tile ...
0
votes
0answers
23 views

How to sample png heightmap in HLSL

I am working on simple parallax shader and I have problem with sampling height texture for value. My aproach amples texture and give me RGB values of picture: tex2D(TextureHeightSampler, ...
1
vote
1answer
52 views

Shader - Convert vector into scalar

I am trying to convert a half3 as a simple half but I am facing an issue. As for an example half3(1, 0, 0) give me white but half3(0, 1, 0) gives me black. How can I convert properly a half3 to a ...
4
votes
1answer
64 views

Why does my Outlined Diffuse 3 shader seem “detached” at a distance?

I'm using the Outlined Diffuse 3 shader from Unity and I'm having a problem with it: the outline looks great when the camera is near the object, but at a distance, it looks detached. From nearby ...
1
vote
1answer
62 views

3D GUI Shader Problem

So I want to create one of these in my directX11 project. The little axis there that shows you the direction. I have a nice 3d shader for my world geometry that I tweaked from Frank D. Luna (He ...
2
votes
1answer
57 views

Proper normal vector transformations in normal mapping

Hello! This question is about transforming normal vectors from normal maps properly. I have tried methods from over five sources, still can't get it to work, and I'm really desperate. Included are ...
0
votes
0answers
56 views

OpenGL model transforms wrong on AMD GPU

I've been writing a program that uses OpenGL to display some simple 3D models (rays, cuboids, spheres and simple meshes). I am targeting the programmable pipeline in OpenGL 3.2. So far I have been ...
2
votes
1answer
142 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
28 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]) ...
1
vote
1answer
114 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
111 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
1answer
48 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
54 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
72 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
35 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
23 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
58 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
42 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
48 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
56 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
65 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
114 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
168 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
80 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 ...
0
votes
0answers
29 views

To FX or not to FX

General confusion... I'm not using Effects11 yet. Regarding the sorting/grouping induced by filenames: Initially I had them grouped by shader type: SomePurpose1.hlsli SomePurpose1_SubPurpose1.hlsli ...
2
votes
1answer
160 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
114 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
87 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
31 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
41 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
59 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
28 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
181 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
37 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
61 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
118 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 ...