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

Is wireframe effect possible without geometry shader?

I am trying to write a shader that highlight the edge between each pair of vertices, much like the UCLA Wireframe Shader. All implementations I came across require geometry shader support. I am ...
0
votes
0answers
26 views

Use FFP and shaders with RTShader system

I'm using some materials that need translation of RTSS and some that has their own shaders. Does RTShader system know to handle both FFP and shaders at the same time?
0
votes
1answer
19 views

Prefab won't change to custom shader

I am writing here as I have encountered a problem with Unity. I have written my own surface shader and want to use it for a prefab. However, when I drag and drop the shader to the prefab in the editor,...
0
votes
1answer
26 views

Vertex shader with extrusion, what am I doing wrong?

So for a simple surface shader, you can use vertex modifier: void vert (inout appdata_full v) { v.vertex.xyz += v.normal * _Amount; } I was thinking the same would work as vertex ...
4
votes
0answers
124 views
+100

Shader to see silhouette through alpha blended sprites

I want to achieve in Unity a see through effect like the one in these examples: In my specific scenario there are a couple of requirements: Sprites are using alpha blending, and sprites have ...
0
votes
1answer
8 views

Fragment shader coordinates: Displacing pixels and texCoord problems

I'm trying to create a shader that creates a displacement on an object, slicing horizontally the sprite. These is an example of the atlas I'm using and the effect I'm trying to achieve: I tried to ...
0
votes
0answers
28 views

Shadow Mapping Distortions only on large polygon surfaces

SOLVED See bottom :) Hi Ive got a GLSL Shader question Ive been teaching basic programming to some young students. Basic and some C++. Ive setup a shader in a modern compiled basic to show what can ...
0
votes
0answers
12 views

Shaders in Unity: Exposing Texture Offset and mapping UV to terrain

Copying from https://forum.unity3d.com/threads/exposing-texture-offset-and-mapping-uv-to-terrain.441128/ Hi all, I'm a bit of a shader noob and have been struggling for a bit with exposing the ...
1
vote
1answer
23 views

alpha test shader 'discard' operation not working - GLES2

I wrote this shader to illustare alpha test action in GLES2 (Galaxy S6). I think is not working at all cause I don't see any change with or without it. Is there anything Im missing? Any syntax error? ...
0
votes
0answers
23 views

FFP Alpha Test shader - function decleration

I'm trying to use FFP_Alpha_Test RTSS from ogre on GLES2 platform. I added the relevant files and built everything but got an error: No matching function for call to 'FFP_Alpha_Test' Fragment Program ...
1
vote
1answer
41 views

I don't think my shaders are working, looking for help

Using sharpdx(directx 11) developing on UWP. This is a link to a previous question of not being able to compile the shader files(written in hlsl) How to compile shader files in UWP Later I have found ...
0
votes
3answers
51 views

How to compile shader files in UWP

I wish to use this method byte[] vertexShaderByteCode = ShaderBytecode.CompileFromFile(".......Transf_VS.hlsl", "VS", "vs_5_0"); this.vertexShader = new D3D11.VertexShader( ...
1
vote
1answer
76 views

how to make a fast fragment shader that converts intensity to saturation?

I have a simple fragment shader that looks like this: #ifdef GL_ES precision lowp float; #endif varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec4 u_desiredColor; uniform sampler2D ...
3
votes
1answer
121 views

Procedural Hatching

I know that it is possible to make a shader that uses procedural hatching instead of pre-designed tonal art maps. But is it possible to make that procedural hatching in the fragment shader? I would ...
0
votes
1answer
38 views

Deferred Shading and material ID

I am implementing a deferred rendering framework, and I wanted to allow programmers to write custom materials. However, I did not find yet how to handle different materials. For now, a material is ...
0
votes
1answer
50 views

SDL2 and OpenGL: flickering with double buffering, what am I doing wrong?

I'm currently fiddling with SDL2 and OpenGL to get an understanding on how they work and, moreover, how shaders are done and work. Right now, I'm following this tutorial, using SDL instead of glfw; ...
0
votes
0answers
30 views

Implementing Phong Shader whith 8 lighting

Reference: Phong Shader I want to use 8 lights (4 red, and 4 green) but my object always has no color . I want to get this result: but my result is like this: For frag code, I have: #version 120 ...
0
votes
0answers
42 views

Is this 2D light implementation with shaders good enough?

After some days reading and programming shaders in GLSL (and Allegro 5) I came up with the stages I will be using to render the lights in my 2D test game. My first goal is to reach something like what ...
0
votes
0answers
22 views

Radial color fill for sprite in Unity

I have a white circle sprite and want to have some "slices" colored of different colors like the image below, with the possibility of changing the "slices" dimensions and color. How would you obtain ...
0
votes
1answer
43 views

Overlap color between objects

I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
1
vote
1answer
67 views

Texture coordinates projection

I have some classic texture coordinates and as a normal behaviour they follow the mesh's transformations. I am trying to use the same texture coordinates behaviour but without being affected by the ...
0
votes
0answers
25 views

Adding a Metal Shader to a Unity Project

I am a Metal programmer and primarily work with native iOS development. I have a Metal shader I would like to add to a project. This project is going to be a plug in and any files I have need to be ...
0
votes
1answer
48 views

BRDF Incorrect specular highlights

I'm currently attempting to implement BRDF lighting, and am hitting a bit of a snag with my specular term - the specular highlights aren't rendering correctly. To make things simple, I'm using a ...
0
votes
2answers
47 views

Is it possible with DirectX11 to have pixel shader output an integer rather than float4?

I am trying to implement object picking via a shaders. My intent is to create a texture2d that I would write out ID values describing individual objects. Following drawing the objects, I would query ...
1
vote
1answer
44 views

Change Shader on This Material Via Code?

How do I change this material to have the Toon/ Lit Outline shader via code at the Start of the scene? Here is my code that I have as of now, that does not work: using UnityEngine; using System....
6
votes
1answer
113 views

Selective Image Effects with Stencils

I am trying to create an image effect where only a part of the image has the effect applied to. One way I can think of to do this is to define the portion of the image using the stencil buffer. ...
6
votes
1answer
130 views

How are Stencil Buffer Operations Applied in ShaderLab

In Unity's Shader lab, I've read that the Stencil buffer is implemented with a mask, and an object reacting to the mask. The mask may be defined like the following: SubShader { Tags { "...
1
vote
1answer
29 views

When is the CheckResources() function called?

This question is asked in the context of image effect shader implementations in Unity. Looking through the scripts for image effects in the standard assets package, I notice that initialization is ...
0
votes
1answer
135 views

Shader / Reconstructing position from DEPTH in VR through Projection Matrix

In Unity you can access the Depth-Buffer in the Pixel Shader. With that Depth-Buffer and the Nearplane, Farplane, CamToWorldMatrix and FOV you can calculate every pixel position of the objects the ...
0
votes
0answers
11 views

Reading from SSBO causes black screen and lag

I tried porting my OpenCL raycaster to GLSL compute shaders. Only I'm having trouble with shader storage buffers. How I initiaize the buffer (constructor of class BufferGL): GLBuffer::GLBuffer(GLint ...
0
votes
1answer
38 views

Unity, cutout texture 2d

I want to be able to have a gameobject that's basically just a black box on top of everything else. Then I want to be able to place other gameobjects which are just gradients on top of that and they ...
0
votes
1answer
70 views

Eye Parallax Refraction Shader

I am trying to implement the Parallax Refraction effect explained by Jorge Jimenez on this presentation: http://www.iryoku.com/downloads/Next-Generation-Character-Rendering-v6.pptx and I am facing ...
0
votes
1answer
34 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
0
votes
2answers
91 views

Having problems sending multiple lights to my shader

I have a lightstruct in C++ which holds the color and direction of the light. const int NUM_LIGHTS = 1; struct lightStruct { XMFLOAT4 Color; XMFLOAT4 Direction; }; And this is how I ...
4
votes
1answer
116 views

Why do we multiply perspective * modelview * point?

A common line in vertex shaders is: gl_Position = projection_matrix * model_view_matrix * object_space_vertex; I've seen this a lot, why isn't it written like gl_Position = object_space_vertex * ...
4
votes
1answer
115 views

Directional light type

I am currently trying to implement a specific directional light type. This light type has been used in the game INSIDE and is called orthogonal spotlight (aka local directional light). I assume that ...
0
votes
0answers
26 views

GPGPU SFX in FullScreen with Compute Shader in Unity?

In various GameEngines, the shader has access to the pixel color of the previous frames. In Unity, I'd like to send all the pixels on the screen to a ComputeShader, process them, and display the ...
0
votes
1answer
53 views

OpenGL ES 2.0 Without The Use of Shaders

While refreshing my mind on OpenGL ES, I decided to read a few of the books I brought a while back and search for some tutorials online. Whilst doing so, I came across many beginner's tutorials that ...
3
votes
1answer
86 views

Would it perform faster to split calculation between vertex and fragment shaders?

Assuming the total amount of computation would be the same (at least as far as my code goes), would there be any performance increase in splitting the calculation and using separate vertex and ...
0
votes
0answers
37 views

Unity equivalent of glDepthMask or alternative

I'm trying to achieve the following setup: 2 cubes. In the image attached they are the green and pink cube. They are both rendered culling their front faces, so that they are visible if a camera ...
0
votes
1answer
44 views

game maker - how to change color palette using shader and texture

how to change the color of the application surface, using the texture?? https://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes https://en.wikipedia.org/wiki/List_of_8-...
0
votes
0answers
44 views

How to build a UI which is bent in Unity, probably with a shader or mapping on a mesh?

So for the moment I'd like to have my UI shaped like a cylinder, later on it would be cool to curve it all the possible ways. So the Cylinder doesn't have to be visible, the UI should just be bent in ...
0
votes
0answers
21 views

Libdgx Sub-Pixel Camera Scrolling

I read this post about sub-pixel rendering: http://code-disaster.com/2016/02/subpixel-perfect-smooth-scrolling.html The idea is you draw your game to a FrameBuffer at a resolution like 320x180 and ...
1
vote
0answers
32 views

Game Maker - Shader CGA - how to swap the palette

I created a shader that get the actual color of the surface and render it to the closer of a cga palette I have to change it to swap the palette in 4 colors but I don't know how secondary, I have to ...
1
vote
2answers
77 views

Problem with Diffuse Lighting

So I am currently implementing Diffuse & Ambient Lighting based off this tutorial: https://www.braynzarsoft.net/viewtutorial/q16390-simple-lighting I think I have implemented everything correctly,...
1
vote
0answers
36 views

Why not tiling on Shader (Sprite/Diffuse)? Unity 5.4.1 f1

Why not have the "Texture Tiling" option in my editor for Sprite / Diffuse?
0
votes
2answers
43 views

What causes this InvalidOperationException when drawing primitives?

I'm working on implementing a 2D masking effect in my current game. To do so, I have two textures, one for the source image and one for the mask. The source image is just a regular texture, so that's ...
0
votes
4answers
65 views

Passing Globally View Matrix and Projection Matrix

This is a general question, and can have multiple answers. However, when doing engine development, what is the best method to share the projection matrix and view matrix with all graphic entity shader'...
1
vote
1answer
19 views

Fragment shader operations before vector transformations

I feel like I'm misunderstanding how to work with vector/fragment shaders. My vector shader is as follows: uniform mat4 uVMatrix; // view (camera transformations) uniform mat4 uMMatrix; // ...
0
votes
0answers
140 views

Valve's Lab Renderer and custom shaders in Unity

I have found that using Valve's Lab Renderer really helps with maintaining a decent frame rate for VR applications, however, the standard shader supplied with the Lab Renderer does not always ...