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

0
votes
0answers
7 views

Unity - How to use instanced properties of a shader?

I just want a simple effect such that on every object using the same material, the texture has different uv offsets, while keeping them batched in one draw call. By my understanding I first tried to ...
16
votes
1answer
2k views

How can I fade player character when he goes inside or outside of the area?

I want to fade the player when he goes out of the area. For example, suppose a person enters a building. When a person is outside of the building, he shouldn't be seen, but when he enters he ...
0
votes
0answers
9 views

Shader to Show outline, and transparent backFace

I would like to implement in my game some sort of occlusion for backward wall. I want, when my camera is inside a wall, to be able to "see" the start of the wall, with a transparency effect or watever....
0
votes
1answer
27 views

How to create post-processing effects in Slick2D?

As I get closer and closer to the end of the feature development for my game and the beginning of the graphical overhaul, I keep thinking of ideas for graphical effects that would make my game even ...
0
votes
0answers
13 views

How can I use Raymarching scene as equirectangular?

I currently output 3D scenes in Unity by rendering cube face textures from a scene camera, as you can see in the below Image: Omnity Cameras From there, I convert the projection to 360^x180^ ...
0
votes
3answers
100 views
0
votes
1answer
50 views

Variable number of light sources

I'm going to be writing a very simple renderer, mainly for learning purposes (using OpengGL). I've been wondering about how to implement support for dynamic number of light sources. Two solutions that ...
0
votes
0answers
40 views

Simple shader that scales UI image from the center

I'm having trouble making a (vertex) shader that scales UI images from the center. I can scale the image, but the image doesn't stay centered. Here is a project showing the problem Here is a ...
0
votes
1answer
51 views

Show Sprites on Overlap (Shader Graph) [2D]

I have a character sprite mesh and mesh renderer (The black wavy box). I am hoping to be able to overlay the black box onto the character covering the sprites but I am not sure how to do that. I ...
0
votes
1answer
25 views

WebGL - two different approaches to Point Light: what is the difference?

So I'm studying Webgl and after directional light I'm approaching point light. So I've seen two different approaches: Take the directional light (diffuse and specular components) and multiply them ...
0
votes
1answer
34 views

How do you write an unlit shader which supports Ambient Occlusion?

For performance reasons, a scene might use Unlit shaders only. Is there an Unlit shader which supports Ambient Occlusion? What is the best way to achieve this look, for moving and static objects, ...
1
vote
0answers
36 views

The gist of tweening with WebGL / OpenGL

I am trying to wrap my head around how to take advantage of shaders for things like tweening. For example, there are these simple easing equations, which we can use like this: ...
0
votes
1answer
49 views

How to use 2D textures in OpenGL / WebGL for physics [closed]

Following along the answer here, it was mentioned about textures: They can also store things like velocities. For example, you can use a texture as a "flow field" for animating particles or other ...
-1
votes
1answer
53 views

The types of buffers typically used in robust WebGL/OpenGL apps

I am trying to get a feel for how to structure WebGL/OpenGL apps and have been looking through sources for the types of buffers they use. I've found these: uvs occlusion noise bitangents tangents ...
5
votes
1answer
174 views

How can I let players “scrape away” one texture to reveal another?

In this game I'm making, I want my players to be able to remove rust from an object based on collisions from another object such as a wire brush. Since it's a VR game, performance is key. I've ...
0
votes
2answers
110 views

Which is the fastest: shaders vs animations / animated images / pixel manipulation?

I'm quite newbie to shader programming. I use Godot engine and after I see what can be done with shaders (eg. http://glslsandbox.com/e#53172.0) I realized that I MUST learn it no matter how hard it ...
0
votes
0answers
57 views

Unlit Node Shadow Shader Graph

How to make unlit node cast shadows? Is is possible with the current state of Shader Graph in LWRP? In this great article Toon Shader OP grabs pass from VertexLit shader. Is something similar ...
2
votes
1answer
52 views

Mixing between two colours in fragment shader causes normal mapping to be ignored

I'm making a game in which the world is black and white except from the immediate area around the player. It all works, except the normal mapping breaks when I turn it on. If I set the output at just ...
0
votes
0answers
54 views

Show the edges between the clipping plane and clipped objects

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
0
votes
1answer
68 views

Normal Matrix in plain English

I'm into shader language with Webgl and GLSL. I've seen some tutorial about normal matrix and I don't really understand it. I mean, I think I'm ok with the math such as: ...
0
votes
1answer
69 views

Unity HDRP Testing - Scene View Issues / Lighting / Shaders / Shadows

Yo Guys. Makings this dope, GlassChess Game, Wanted to try out the new HDPR in unity 2018, add the package and volia, its working. (done all settings) So I used custom glass shader before trying out ...
1
vote
0answers
11 views

Reflection shader (orginated from XNA 10 years ago) doesn't work - Model is just black?

can anyone help me with this one. I'm creating a 3D game. For my game, i have created a lot of 3D objects. Im everything works as intended so far, but I'm trying to implement a "Chrome Reflection" ...
0
votes
1answer
34 views

OpenGL Texture Zig-Zag Artifacts Over Time

I'm working on a deferred shading renderer in OpenGL, where I write all geometry output to Colour, Normal and Depth textures and then apply lighting effects later. Everything seems fine except once ...
0
votes
1answer
74 views

opengl - flickering of fragments even with disabled depth test

I'm trying to render a quad with a coloured border. I'm using texture coordinates to detect whether the fragment should be considered part of border or not. If it is part of border, then render it ...
4
votes
1answer
57 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 ...
0
votes
0answers
29 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
0answers
43 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
24 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
41 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: ...
1
vote
1answer
52 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
1answer
109 views

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
0answers
47 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 ...
2
votes
1answer
66 views

Planet Surface Rendering: Precision issues [duplicate]

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 ...
1
vote
0answers
74 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 ...
0
votes
0answers
17 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
29 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
39 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
45 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
113 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
105 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
54 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
94 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
37 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?
12
votes
1answer
289 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 ...
1
vote
0answers
48 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
37 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 ...
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
38 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
36 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
21 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 ...