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

Unity: cg fragment shader processing array of points

I need to write a fragment shader which would somehow be aware of N points that are in the scene and darken pixels based on their world coord distance to the points. I'm looking for a method that ...
0
votes
0answers
11 views

HSLS shader for floating point (grayscale) textures

I have the following problem: Input data is a float[], representing a 2D texture with floating point values (I need the dynamic range to be larger than 255), e.g. size 100x200. I would like to ...
2
votes
1answer
36 views

GLSL 2D Silhouette

I'm trying to render a silhouette of any entity behind foreground objects to indicate their position to the player. Here's an example of what I want to achieve, from Hyper Light Drifter: From what ...
1
vote
1answer
21 views

ETC1 Support on android alpha problem (GLSL cocos2d-x)

I want to support etc1 in my game, but somehow it doesn't work (I'm using cocos2d-x C++ GLProgram* glp = new GLProgram(); glp->initWithVertexShaderFilename("testv.vsh", "test.fsh"); ...
6
votes
0answers
54 views

Short cut grass Shader? or however you do that

I've been looking at some screenshots from games like Rocket League #1 Rocket League #2 and Fifa Fifa #1 and i started wondering how you would achieve the short cut grass effect. Is it a ...
0
votes
0answers
35 views

Outline with toon shader in unity is way too large

This is what's happening to the model I've attached this toon shader to. It seems to be creating this black hole of some sort and I can't figure out why and how to fix it. I would just like it to ...
-1
votes
0answers
27 views

Shader request (cg shader provided) : an xBR scaling shader for Unity

I'd like to scale up my game view from a native resolution of 512x300 to 1024x600 using the xBR cg shader found here : https://github.com/libretro/common-shaders/tree/master/xbr Here is a question ...
0
votes
1answer
27 views

OpenGL Shaders Ignored

I have been following this tutorial to try and start learning OpenGL. However, upon compiling my code, my triangle turns out to be black. At first I thought that there was something wrong with the ...
1
vote
0answers
43 views

Blinn-Phong lighting on Voxel models

I'm creating a game that is going to use voxel models. However I got stuck when I coded my shader using Blinn-Phong algoritm. Here is how it look (Only care about the red model): As you can see ...
-1
votes
0answers
38 views

Shadow in Aughmented Reality

https://www.youtube.com/watch?v=ifcqbvvY78w Can some one help me, how to make shadow like this video. I tried to make shadow like this video, but i failed. So many thank's for you all :)
0
votes
0answers
19 views

Add Atten property in Unity Shaderlab

In Unity Shaderlab shader, Is there any way to apply _Atten value? Using surface shader, and vertex/fragment shader I can do it easily. But, I didn't find any reference to do that in Shaderlab ...
1
vote
1answer
32 views

Environment mapping - cube mapping using OpenGL

I'm trying to do cube mapping. Problem is that I'm getting this: This is what I get when I rotate it: But it should look like this Here is code for vertex shader varying vec2 tex_coord; void ...
3
votes
2answers
46 views

Render Occluded pixels to gray color

In 3d space, objects can be occluded by another objects. By depth testing, the occluded faces are skipped rendering. Only the nearest(smallest) depth value pixels are drawn. But, sometime we need to ...
1
vote
1answer
48 views

How to debug a GLSL shader? [duplicate]

I cannot find any tutorial in Google and Youtube. I have a C++ program that uses OpenGL ES 2.0 API to render something on the screen. How can I debug my shaders? Any step-by-step guide? What is the ...
9
votes
2answers
1k views

Rorschach ink blot (aka Psychology test pictures) shader

I want this magnificent pattern to be in my game. So far I have figured out... Draw one side, then render it twice left and right. How do I render this pattern on one side? hmm... I need help. ...
1
vote
1answer
50 views

How to create a material that blends textures in Blender to Unity workflow

I'm new to Blender and Unity and trying to figure out the best way to create a material that will use either vertex colors or a texture map to interpolate between other textures on a single mesh. ...
0
votes
0answers
37 views

speed/power trade-offs in sprite-based vs shader-based games?

I'm trying to understand how expensive (speed-wise and battery-wise) certain shader-based code is compared to the sprite-based code I'm used to. I apologize up front that this question is a bit ...
1
vote
0answers
65 views

Using GrabPass for 2D water reflection?

I'm trying to achieve some neat 2d water reflection effect with Unity, something like this: What I've managed to accomplish so far: The problem is GrabPass captures the entire screen but I really ...
4
votes
2answers
136 views

Discoordinated Chromatic Aberration Effect

The game Teleglitch heavily utilizes the CA effect with screen distortion. I am trying to achieve this effect. Issue 1. How to not apply the effect onto the floor? (solved) They render the screen ...
0
votes
1answer
28 views

Stencil based mask with alpha

I'm trying to create a fog effect like civ 5: I tried creating a StencilSet shader that receives a mask and sets the stencil buffer to 1. I would render the following on every unexplored tile using ...
1
vote
0answers
51 views

Taking a 2D slice of a 3D volume

I have a regular 3D polygon and I'd like to display 2D slices of it. What is the best way to achieve this? (Preferrably in OpenGL, but a general algorithm/tecnique would be good as well). I've ...
1
vote
0answers
32 views

Why would an ambient occlusion (AO) shader's performance be dependent on light direction?

One of my favourite games recently implemented ambient occlusion as a graphics feature, which appears to perform very well in most circumstances - except during sunrise and sunset. As someone who is ...
1
vote
1answer
40 views

Share a function between two passes inside CG Shader for unity3d

I'm writing a shader in CG language for Unity3d. When making transparent object you need to create two similar passes in SubShader. First to render only back faces (with Cull Front) and second to ...
3
votes
1answer
127 views

2D day night mapping

I'm looking for this kind of effect MINUS the lights and snow (Another problem). It needs to change depending on the time of year. Doesn't need snow or city lights. Now I'm pretty new to shaders ...
0
votes
1answer
50 views

Basic vertex shader, moving

I am new in shader concepts and I am trying to implement a sprite of 8x8 in OpenGL ES. I want to move the texture in the vertex shader but I cant figure out how to this, my code may be wrong, feel ...
0
votes
1answer
61 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
1
vote
3answers
23 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
25 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
25 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
18 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
25 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
93 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] = ...
-1
votes
1answer
189 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
0answers
43 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
28 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
133 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 ...
3
votes
0answers
66 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
102 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
70 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
38 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
60 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
70 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
84 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
75 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
60 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
215 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
44 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
126 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
131 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
67 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.