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

How to apply individual colours in a fragment shader?

I'm trying to write my own shader. Within the target mesh I have assigned the following attributes in a script: mesh.vertices = points; mesh.colors = colours; //Each element of the array hold a ...
0
votes
0answers
32 views

Linear gradient shader ( Photoshop-like)

I'm searching a way to implement a linear gradient shader that behaves as the linear gradient in Photoshop (only the vertical case is necessary). It will be applied to 2D sprites. Currently I'm ...
1
vote
1answer
27 views

How to get color or value from material with shader?

I have a sphere with a shader with colors for specific heights and I want to get the value at the cursor(height) or color of the point the cursor is on when clicked. Is there a good way to get this ...
1
vote
1answer
34 views

Shader only rendering 1/4th of the screen

I've asked the same question on SO here and they suggested I should ask here instead. I'm currently trying to create a gaussian blur shader, and while I've successfully created the blur effect my ...
3
votes
0answers
49 views

Depth of Field Blur - Weighted sampling?

I've been studying Intel's fantastic article titled "An investigation of fast real-time GPU-based image blur algorithms" (here), where-in they state that Gaussian blur would need to be customized for ...
0
votes
0answers
20 views

Low intensity of projector in dark enviornments

I am using light Projector as Headlight for player bike....The thing happening is the intensity of projector reduces in dark environment whereas in normal sunny day projector brightness is proper ,. ...
0
votes
1answer
19 views

GLSL uniform array with size set by another uniform

Will the follwing GLSL code work? #version 330 uniform int size; uniform float[size]; void main() { //do something }
3
votes
1answer
49 views

Upgrading Unity from 5.1 to 5.3.4 has broken game, specifically models made in Blender

I recently decided to upgrade Unity after putting it off for some time as I have a rather sizable project started in 5.1. I knew there would be some hurdles, however, I have had very little luck in ...
1
vote
0answers
23 views

Unity Shader blending colors and color values above 1

I have source images where each pixel is one of exactly 4 colors: red = (1,0,0) green = (0,1,0) blue = (0,0,1) black = (0,0,0) I'm trying to modify Unity's default sprite shader to use those ...
0
votes
2answers
57 views

How to optimize this branching instruction?

I have an outline shader, which samples my texture 8 times to compute the outline. The problem is, that there's transitional alpha values between picture and background. To cut them off I'm using the ...
0
votes
1answer
42 views

When do I need to call `glUseProgram`?

Looking at examples at http://learnopengl.com/#!Getting-started/Hello-Triangle and many different places, I've found that the draw sequence usually goes like this: // setup VBO, VAO, load shaders ...
0
votes
0answers
10 views

How to do an xBR or hqx filter in MonoGame?

I have been trying to implement an HD filter (xBR or HQX) in my MonoGame game project but so far got no success. I have checked out this question, but the shaders provided in the answers don't seem to ...
1
vote
0answers
104 views

How can I create a wind visual effect like Ori?

I'm working on a mobile game in Cocos2D. The game mechanic is very similar to Ori and the Blind Forest's parachute (Kuro's feather) mechanic. I want to be able to render a visual effect for wind ...
0
votes
0answers
29 views

Pixel Perfect Texture Sampling

Right now I am using the following two shaders to render a sprite from a texture used as a sprite atlas onto a canvas that has canvas_size pixels in screen coordinates. I use a static quad as input ...
1
vote
0answers
11 views

Unity: Built-In Shader Transformation Explanation Resource

I'm working on some of my first shaders and taking a look at the variables included by cginc I see this list of transformation matrices: I've watched some beginner talks and I understand what the ...
0
votes
1answer
20 views

Opengles 2.0, Replace the black region in the image to make it transparent

I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do? This is my shader language: ...
3
votes
1answer
89 views

Sine-based Tiled Procedural Bump

I am trying to implement this formula to generate bump but I am facing some issue. The result doesn't look the same it's much darker. Here is my result (without same parameters) but it is much ...
0
votes
0answers
50 views

vertex shader doesn't work properly

Linux, OPenGL 3.0, GLSL 130 (Intel card) I'm learning OpenGL and successfully rendered a triangle, but as soon as I create the matrix of projection I get an error. The shader compiles and works ...
0
votes
0answers
28 views

YUV target on GL_TEXTURE_EXTERNAL_OES

I am using a surface texture bound to GL_TEXTURE_EXTERNAL_OES. I read that the GL_TEXTURE_EXTERNAL_OES texture target is usually in a YUV color space. I want to take "y" value for each pixel in ...
1
vote
1answer
38 views

Unity simple solid color alpha shader

I searched for a shader, where I can set a solid color, which I can fade in or out like I want. There is not such a thing build in as far as I could see. Now I got this code, which works fine in case ...
3
votes
0answers
44 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I ...
1
vote
1answer
47 views

Solution for Shipping Optimized and Minified GLSL?

I've tried to find a reputable optimizing compiler for GLSL that takes source shaders, performs what optimizations it can statically assume, and outputs a minified GLSL file with optimizations, ...
0
votes
0answers
32 views

Profiling frame rate in shader

I used adreno profiler to profile a mediaplayer shader application: source : https://github.com/crossle/MediaPlayerSurface/blob/master/src/me/crossle/demo/surfacetexture/VideoSurfaceView.java The ...
0
votes
0answers
45 views

How do I procedurally generate a histogram from an image?

I have a media player application which uses shaders. I'm searching for the best way to generate a histogram for the displayed image. I've thought of these 2 approaches: Generate histogram using ...
1
vote
0answers
54 views

Is it possible to use true Blinn-Phong lighting on Unity Android/IOS?

I've noticed that the Unity's Legacy Shaders/Specular shader does not work on mobiles due to the lighting model being incompatible. I then tried using the Mobile/Bumped Specular shader, but this ...
0
votes
0answers
29 views

Shader questions with regards to the SpriteBatch in XNA/MonoGame

So I've finally decided to create my very own GUI system. And I'd like it to use shaders for pretty much all rendering. Think "WPF/Direct2D Brushes". Except to my knowledge, using shaders with the ...
1
vote
0answers
17 views

A question about Decal projection

From my understanding, there are several different ways to implement decals, from screen space, to copying geometry, but I can never find an explination of it's math. So what exactly is the math ...
4
votes
0answers
37 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
0
votes
0answers
32 views

Billboard a quad to a position

I am trying to make a custom billboarding effect. I know that standard billboarding causes a quad to always face a camera, taking the camera position and view direction into account. I want a slightly ...
1
vote
0answers
34 views

How to have a gradient blur in objects on Unity?

This is related to a previous question I've asked here: How to blur entire scene but a specific spot in Unity? At the time I managed to solve my problem with a "hard" cutoff on the blurred and ...
-1
votes
1answer
136 views

Create YUV texture for GL_TEXTURE_EXTERNAL_OES format

0 down vote favorite I need to create a yuv texture for GL_TEXTURE_EXTERNAL_OES format. source : ...
1
vote
0answers
26 views

Combining skydome and fog

I am developing a 3D game in DarkBASIC Professional, and I have a theoretical problem with the combination of skydomes and fog in general. My question is not specific to a programming language, so I ...
0
votes
0answers
43 views

How to create Line of Sight shader?

I have an algorithm to build my sight polygon: https://www.youtube.com/watch?v=x7tFnVX11x0 I want now to create a visibility from it that is similar to this: ...
0
votes
0answers
33 views

Failed to pass uniform in Metal shader modifier

I'm trying to write a simple shader able to pass the color to be used for drawing in the fragment shader, through a uniform. I load the shader modifier and pass the uniform: let fragmentShaderPath ...
0
votes
1answer
47 views

Strange shadow behavior when light direction is parallel to a plane

i have a strange problem with shadow acne. It occurs when the light direction is parallel to a plane. Here is my code and a few images of the problem: //this calculates the shadow matrix ...
0
votes
1answer
41 views

Does Specular Power affect the Brightness?

I read the book Real-Time Rendering, 2nd Edition. Somewhere in there it say: But I did the experiment and concluded that the mshi doesn't seem to affect to the brightness (it causes the area just ...
1
vote
1answer
35 views

About HLSL array packing policy

This is not a question but a confirmation if I'm correct about the behavior of HLSL arrays. I'm working with a standard lighting vertex shader, HLSL plus C++, DirectX11.1 API. For storing my lights ...
3
votes
0answers
129 views

Schlick Fresnel Shader

I hope you are all doing ok. I have an issue with my Fresnel shader that doesn't allow the Fresnel to change as my camera moves around. I'm not sure what i'm doing wrong. I'm using glsl with the ...
8
votes
2answers
162 views

Why is the distance from object to eye irrelevant in illumination models?

For example in Phong model and Blinn model, the light intensity does not change depending on how far away the camera is. Why is that?
1
vote
1answer
38 views

Doubts with results of per-vertex lighting shader

I'm researching simple shaders to add to my DirectX 11 project such as a per-vertex diffuse shader plus specular reflection component. I'll begin with the results: Seems specular reflection is ...
0
votes
1answer
50 views

GLSL Shader not compiling (Android & LibGDX) and no log available

I'm trying to get a "ripple"-shader working for OpenGL ES 2.0+ (using LibGDX). However, I can't get it to compile, and for some reason ShaderProgram.getLog() returns an empty string even though the ...
0
votes
0answers
60 views

water shader - different wave speed among the mesh

I'm working with Unity, but I'm trying to phrase my question in a more general way. Imagine you have a plane with a water shader/script on it. With the help of a scrolling/moving bump map the water ...
0
votes
0answers
54 views

vert/frag custom shader - Shadow is not correct, showing strange artifacts

I am new to shader writing, I want to drop shadows in my own shader, but unluckily I am getting a strange behaviour. When I apply a simple surface shader (Lambert, written in unity shader lab) it ...
0
votes
2answers
95 views

How do I draw individual pixels in the distance?

Hello everyone I am working with unity3d and I am faced with a task. I have a list of 3D points and I want to draw a pixel for every point on the list that exists after my cameras frustums far-plane. ...
0
votes
2answers
47 views

Hide building roof & Hide faces/vertices depending on world location

I'm currently developing a small game for my own enjoyment and I've ran into a problem. As you probably know many third person games (such as Runescape and XCOM, for example) hide the roofs when you ...
1
vote
0answers
25 views

How to set a specific face's texture color in Unity?

First off, let me describe my situation... So I'm building a voxel engine based on this tutorial. I'm using my own texture tilesheet. Most of the tiles have their own color except grass, leaves, and a ...
0
votes
1answer
24 views

Axis Aligned Bilboards in shader

Hi I need to implement following effect using vertex shaders. Basically its a shader for particle laser beam that rotates to particle along its own y axis till its "best" visible (Roughly). My idea ...
0
votes
1answer
76 views

Custom Terrain Shader Normal Map Issue?

I've been developing a custom terrain shader in Unity. And I've been having problems with my normal maps. Even after hours of fiddling I still haven't fixed it yet. There are 2 noticeable issues: 1. ...
0
votes
1answer
40 views

Iris-wipe shader not properly working

I'm working on creating an iris wipe transition, like the ones you see in old cartoons - a fully transparent circle closes on a certain point, leaving a full screen of a solid color. Additionally, the ...
9
votes
1answer
132 views

Cycling through colors with the same brightness

Ok. So I have a game I am working on with a bunch of colored particles. Each of them gets their own color however they are all close to a specific shade. To explain that better I am using the HSV ...