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
1answer
69 views

Why are faces being drawn like this with my custom shader?

I've been writing a custom surface shader which allows for vertex colors (with alphas) to be set programmatically. From test runs of the shader itself, it works perfectly fine, and I am able to set ...
0
votes
1answer
36 views

Why is my custom shader rendering completely transparent?

I'm currently trying to learn how to write shaders, so I'm getting my feet wet with Unity's Shaderlab format. One of the first things I tried was to write a surface shader that supports vertex colors ...
1
vote
0answers
20 views

Correct form of the GGX geometry term

I'm trying to implement a microfacet BRDF in my raytracer but I'm running into some issues. A lot of the papers and articles I've read define the partial geometry term as a function of the view and ...
1
vote
1answer
43 views

Rendering issues in Monogame when using shaders

I am currently fiddling with Monogame, trying to work with Shaders and I have encountered a really weird issue. If the first ever draw in the application's lifetime is with a custom shader all further ...
0
votes
0answers
17 views

HLSL texture not reading from register S1

I made a simple post processing shader, that draws scanlines. This all works perfectly. I wanted to make it a bit more interesting by applying a shadowmask instead so I wanted to pass a texture to the ...
1
vote
0answers
13 views

In Unity shaders, how is IN.worldRefl calculated?

I want to know how the world reflection vector in shaders is calculated so that I can manipulate it, but there is no documentation on what it does or how Unity calculates it. How is the reflection ...
1
vote
0answers
13 views

HLSL topology mismatch question

I'm trying to write a fur shader with the shells & fins technique. Currently I receive this DirectX error D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The declared input primitive type in ...
1
vote
1answer
28 views

Implementing my own UI sprite class in Unity using shaders: where and how to position the sprites

For learning purposes, I am trying to implement my own UI classes in Unity "from scratch", in the GPU using shaders. I mean, I am trying to use simple 2D sprites either positioned via shaders or ...
0
votes
1answer
40 views

GLSL - Only draw arond point / flashlight effect

I'm currently trying to achieve a sort of flashlight effect in GLSL. I only want to draw textures within a certain distance of a specified point (the mouse position, for example). Here's a quick ...
2
votes
0answers
31 views

Is there a way to identify, within a shader, the current GPU thread ID?

My question is rather simple: within a shader, is there a way (that works both in DirectX and OpenGL) to retrieve the ID of the given GPU thread being executed at the given iteration? I am using ...
3
votes
0answers
58 views

Particle-system in the GPU in Unity: how to load/store data from/to a texture in the shader?

I have been implementing a simple GPU-based particle system in Unity, for my current game. The setup is indeed not very elaborated: the shader receives a set of coordinates passed trough the position ...
3
votes
2answers
130 views

Bullet holes on curved surfaces and corners

So right now I am making an FPS game where the gun creates bullet holes (plane with texture) on impact, but there is a problem with that, if I shoot at the edge the plane will stick out and also ...
2
votes
0answers
21 views

DirectX 11 - Problem with low resolution decals

I'm trying to add a decal system in my DirectX engine but i'm facing some problems with the quality of the textures projected. Every other no decal texture look fine, but these ones look really bad. ...
0
votes
0answers
20 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
37 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
50 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
42 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 ...
4
votes
0answers
71 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
24 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
60 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
30 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 ...
1
vote
2answers
59 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
48 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
13 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
110 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
36 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
25 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
97 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
51 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
39 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
46 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 ...
4
votes
0answers
48 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
54 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
88 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
33 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
42 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
36 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
38 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
156 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
28 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
47 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
38 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
48 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
51 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
44 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 ...