Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

1
vote
1answer
11 views

What makes a shader function with a LineRenderer?

A LineRenderer has both Material and Color properties. But many shaders do not work, ie the line will not respect the Color property, or the line will show black (regardless of the materials having ...
11
votes
1answer
227 views

How can I make outline shader like “Life is Strange”?

I want to make sketch shader like life strange. shader has two part: 1.animated dashed line 2.noisy outline I like to know how can I make noisy outline? see outline of objects First I tried to ...
0
votes
0answers
22 views

Blur shader showing Pink color?

I got this shader from GitHub page. In my scene, which is "LWRP" the image that should appears blur effect, it showing Pink color and there is no effect. Here is the shader script. ...
1
vote
1answer
50 views
+50

How to write a PBR Unlit Shader in Unity?

I have a REALLY specific case here: I have an Texture (a webcam), that is used by a shader to pickup a few x,y colors at the cordinates, and renders to a ...
1
vote
1answer
34 views

HLSL equivilant to “Object” data from “Texture Coordinate” node in Blender

I mocked up a shader how I wanted it with the node editor in Blender. Now I'm trying to write it in HLSL. In Blender there is a node group called "Texture Coordinate". If I use the "uv" node from the ...
1
vote
0answers
35 views

Whats the least expensive way to play video in unity?

Alright, Ive asked this various ways but my situation is I have several (over 100) objects that have screens that need to play animated videos on them. There does not need to be sound, but this is for ...
0
votes
0answers
11 views

Unity 2019 Extremely Reflective Foliage

I've been working on a project involving a lot of foliage and I needed translucency so I upgraded to the latest unity beta to get access to the new features and the HDRP (which is still available on ...
0
votes
0answers
15 views

Compiling a simple shader in PyOpenGL

I am starting with OpenGL and I am translating the code from learnopengl to python and for some reason I am not being able to compile the Vertex Shader. This is all that I have: ...
46
votes
7answers
56k views

How can I draw outlines around 3D models?

How can I draw outlines around 3D models? I'm referring to something like the effects in a recent Pokemon game, which appear to have a single-pixel outline around them:
1
vote
0answers
45 views

Alpha is not working in diffuse light shader

I am following this tutorials series on rastertek.com and I got a bit stuck on the Diffuse Lighting Tutorial. Particulary, the part that does not work for me is alpha channel of the light color. Here ...
1
vote
0answers
32 views

Trying to convert Unreal shader graph to Unity, what nodes are a close equivalent in the Unity shader graph?

I am trying to convert an Unreal shader graph to a Unity Shader Graph. https://api.unrealengine.com/udk/Three/VolumetricLightbeamTutorial.html I am struggling with understanding which nodes to use ...
1
vote
1answer
49 views

Planet Surface Rendering: Precision issues

I have been experimenting with C++ and OpenGL, and I am currently writing a program that renders the surface of a planet; specifically, our moon. It's a modified version of the GPU Gems implementation ...
0
votes
1answer
388 views

OpenGL Vertex shader matrix multiplication causes triangle to disappear

So i have a very basic functioning application, rendering a basic triangle (using vertex and fragment shaders) When I try to multiply the in-vector in the vertex shader with a mat4 the triangle ...
0
votes
0answers
14 views

Trees made with Unity's Tree Editor have 2 sides: 1 bright and 1 normal

(The directional light lits the side shown at the right side of the picture.) I tried changing shaders, but that just makes the bright side fully dark. I tried changing Ambient Occlusion but that ...
0
votes
0answers
25 views

How to access lighting data of a different Pixel in a Unity Shader?

I'm trying to write a shader with "block/tile-wise lighting" for sprites (Coloring entire objects/tiles with the same light & brightness). I've started with modifying the /Sprites/Diffuse shader. ...
1
vote
1answer
33 views

How to access Lit shader properties through code?

Currently i'm using HDRP in my project, so i have a question. How can i access Lit shader properties through code ? Or where i can see names of variables in this shader ? For example:
0
votes
0answers
24 views

How to stack shaders in Godot?

I have a CanvasLayer singleton that I am using for transition effects between scenes in my game. This CavasLayer contains a ...
1
vote
1answer
62 views

Morphing a 3D model into a sphere or cube using a vertex shader

I want to morph between 3d models.I found a simple OpenGL code to morphing In Graphics Shaders: Theory and Practice(page 456) but I couldn't Implement it correctly in unity. ...
1
vote
1answer
52 views

Does Unity3D custom shader use its default GPU or CPU skinning automatically?

I'm writing my own shader in mobile, but was wondering if it uses default GPU or CPU skinning feature in Unity3D? I'd like to use GPU skinning and already enabled GPU skinning. Is there any way to ...
0
votes
0answers
27 views

Wind Trees from Book of the Dead in a Separate Unity Project

I want to make wind work on a project separate from Book of the Dead demo. I've been able to import the tree assets, plus the WindControl script and two helpers ...
1
vote
0answers
51 views

Draw a perfect circle in UI

This is the problem I have. I have created a shader that draws circle. But depending on the distance from the camera thickness changes. Is it possible to keep thickness constant?
2
votes
1answer
34 views

How to detect syntax error in unity shader scripting

Hi. I'm following shader scripting tutorial and I often make syntax mistakes. like other languages, can you have visual studio automatically underline with red color?
2
votes
2answers
1k views

Can a texture's UV coordinates be animated (scrolled) when part of a SpriteSheet?

Alright so my question is about texture manipulation in Flash Stage3D / Context3D using AGAL for the shader language. But I'm ...
9
votes
0answers
280 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 am ...
1
vote
0answers
22 views

Hard coded triangle in HLSL geometry shader doesn't show on screen

In Unity I'm planning on using a geometry shader for processing points into quads and can't quite figure out why I'm not getting output from my geometry shader. I've edited it down to a minimum ...
1
vote
0answers
27 views

Unity Shader: Make water on terrain transparent without fading

I want to create a shader for a terrain to make the water fully transparent but not invisible or faded. In this example I would want the purple square to be seen through water but not through the ...
0
votes
1answer
56 views

Why do I get an unexpexted token error while compiling this shader?

I get the following error syntax error unexpected token vertex I am still learning shaders so I can't really understand the reason for this error. How can I make this shader work? ...
2
votes
0answers
61 views

Trying to get Vertexshader to work Monogame 2D

If I don't use the vertex shader, it gives me white textures which is what the default color is. Once I add the vertex shader, the screen is black. I figure it is something wrong with the Matrices I ...
1
vote
0answers
30 views

Is there a way to set a shader define in Löve?

I know I can use shader:send() to change variables, but is there a way to set/change a #define?
0
votes
0answers
23 views

Blinking color shader

Currently i'm using Unity3D, and i want to make one variable blink along time in a fragment shader. Now i have code like this: ...
0
votes
1answer
20 views

Setting shader by script?

I make s shader file and drop it on object with material. I wrote this script to run shader when press Space button. All is good except that script not load shader when run the game !! I have to do it ...
3
votes
1answer
2k 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: ...
0
votes
1answer
36 views

Godot: error(10) expected '(' after Identifier

When trying to write up a new shader for a material, I've been trying to create a variable to use to alter speed and test animation. Now, the below outputs fine until I try to assign a value to number....
0
votes
2answers
106 views

GPU Gems Chapter 1, update normal

Had plans to follow GPU Gems to gain knowledge in Shaders - but my journey came to an abrupt end. ...
0
votes
1answer
462 views

LibGDX - Draw multiple textures with different positions with one shader?

currently I'm optimizing my render calls by drawing multiple textures with one shader. The background textures who all share the same position are no problem. But now I want to draw some Textures with ...
0
votes
1answer
62 views

Object Lit/Shader or huge distance from origin problem in large unity project

I have a very large environment where i am getting very weird view of objects as picture given below: As you can see there are black lines/spot, maybe the vertex lit problem. Currently I am using ...
0
votes
1answer
52 views

How can I transform a world space point to a camera's screen coordinate?

I'm trying to transform a point in fragment shader from world space to screen coordinate of a second camera. Not the main one. I think I know how to achieve that to the main camera, but I'm ...
1
vote
1answer
293 views

Particles not rendering over projectors

I am using projectors for shadows...When I use particles for bike speed up i.e., nitro speed the particles get cutout by those shadows.... Here is screenshot of it, Here is my shader code of ...
0
votes
0answers
43 views

Adding drop shadow to text in Minecraft

I would like to know how to take a text object rendered using the default Minecraft font renderer and add a drop shadow behind it. I believe what I need to do is make a copy of the text object, ...
1
vote
1answer
2k views

convert view space normal to world normal

Im writing a shader that uses Unity's _CameraDepthNormalsTexture to get both the view normal and depth values. I return a color from my fragment shader equal to the normal values sampled. I am ...
0
votes
1answer
39 views

using a wire-frame shader on a plane how can i also fill in the squares with a solid color so that each square's color can be changed?

I'm not sure if using a shader is the best way for what I'm trying to achieve, but I would like to apply a color to each of the squares like in the picture and have the ability to change each color ...
0
votes
0answers
38 views

How I can create HQx or xBR pixel art upscaling shader in GLSL?

I want to make an image scaling shader in OpenGL Shader Language... but I have no idea how to make it. I want to implement either the HQx algorithm or an xBR variant. My game engine is GameMaker: ...
1
vote
1answer
442 views

Unity procedural skybox shader texture stretching

I am using the procedural skybox shader that Unity provides, but have tweaked it so that I can have a cloud texture. The problem I have, is that the texture is not tiling correctly, even though it is ...
0
votes
0answers
29 views

How to make plane thick with shader in Unity?

I use plane as wall, door,... using Double Sided Shaders. I just want to make my wall, door,... thicker so it doesn't look like paper, I don't need to make it look super realistic. I wonder if I can ...
1
vote
1answer
1k views

Run Simple HLSL Pixel Shader with DirectX 9

I'm trying to run HLSL Pixel Shaders with DirectX 9 where I feed a texture in, run the HLSL code and copy the resulting texture back from memory. I think I'm getting pretty close, although a LOT of ...
0
votes
1answer
78 views

How can I write an additive mesh shader that splits the RGB channels while accounting for depth?

I'm trying to create a sort of "hologram" effect. So far, what I have is an additive, three-pass shader that uses ColorMask for each pass to separate the RGB channels. The problem is that doing so ...
3
votes
2answers
985 views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
4
votes
1answer
210 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
1
vote
0answers
80 views

How can I make Matrix Rain?

I want to make 3d Matrix rain like this shader that you can rotate camera.I tried to convert this shader but It have many calculations that it's expensive inside game engine.then I tried to make this ...
0
votes
2answers
63 views

Shader vs Working with Pixels

I am working on 2d games only. In that context, when would I ever need to use a shader rather than simply manipulate the pixel-data of an image? For example, I have an image of a car and I want to ...