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
2answers
65 views

2D Camera Movement Temporal Reprojection

Having an Orthographic Camera with its View Projection Matrix given from the current and last frame, how to reproject the previous frame to the new one?
0
votes
1answer
1k views

How to use a .mtl file in Unity?

I want to use a .mtl file to draw my objects in unity. Can I somehow convert a .mtl file into a normal Unity material? My .mtl file is like this: ...
0
votes
1answer
1k views

Using ShaderGraph for UI elements with transparency

I am trying to design some UI elements using shader graph. In this case specifically a lifebar that is transparent where empty. For a normal lifebar with a filled and empty color I got it working ...
4
votes
1answer
283 views

Show Unity Line Renderer as 3d cable or wire

I am dynamically making a line renderer which is pull by the character to show that a character is pulling a wire. The line renderer working fine but unfortunately its display is not according to my ...
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 ...
3
votes
2answers
189 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. ...
2
votes
2answers
3k views

Writing and reading Computebuffer in a Shader

I'm trying to write into a Computebuffer in the fragment shader, but it doesn't work. Its pretty hard to get the Depth-Value in the Compute Buffer, so it would be so easy to just use the Pixel/...
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
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, ...
5
votes
2answers
586 views

Why does my point light shader shows a strange behaviour, and how do I fix it?

I follow the well known tutorial about lighting and model importing using Learn opengl, i copy paste the code from the site. The author claims that the shader works but when i compile the source code, ...
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
1answer
383 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:...
0
votes
1answer
93 views

why my shader is black in the game mode?

I used this useful blending modes It's good but it just work in Editor mode. what is the problem?! ...
0
votes
1answer
725 views

Drawing a grid over a terrain using a mesh - Shader Depth and Z-Buffer

What I'm trying to achieve is rendering a (huge) tile grid over a terrain. For that I'm using a generated mesh of quads, one for every tile, whose vertices Y value is the same of the terrain to "shape"...
0
votes
1answer
146 views

Issues to display a texture loaded with libPNG with opengles 3.0

I'm trying to load a texture loaded with libPNG on a XY coordinates. I know the width and the height of the texture (32x32). The texture is already loaded successfully and I have his Id. Here is my ...
0
votes
1answer
29 views

Unity2D: Sprite Mesh Lighting Issue

I am trying to make my 2D mesh render sprites with the same brightness as the original file. On the below picture, the mesh on the left is darker than the UI Image on the right, which is an exact ...
9
votes
2answers
14k views

What is the best method to update shader uniforms?

What is the most accepted way for keeping a shader's matrices up to date, and why? For example, at the moment I have a Shader class that stores the handles to the ...
0
votes
1answer
156 views

World space coords for 2d images

How can I make an 2d image using World space coords with a shape? Like a circle instead of a quad.In 3d you can modify the vertices but if I want a smooth circle there will be too much vertices. What ...
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
1answer
50 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
68 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 ...
0
votes
1answer
49 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 ...
-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 ...
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 ...
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
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
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
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: ...
2
votes
1answer
65 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 ...
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
54 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 ...
1
vote
1answer
527 views

Unity shaders - blend edges of tile textures stored in an atlas

I'm creating a tile based game. The tiles can have different textures. All the textures are loaded at startup and dynamically packed in a texture atlas (this is done to make modding easier). Each tile ...
11
votes
3answers
2k views

How can I make natural rain drops on screen?

I'm trying to make rain effect drop with metaballs and trail on screen.I find a clue in shadertoy but I didn't understand how implemented: https://www.shadertoy.com/view/ltffzl unfortunately it 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
4answers
1k views

Combine flat and smooth shading with a single model geometry

I need to be able to switch between smooth and flat shading interactively. Is there a way to do this efficiently with a single geometry? For example, smooth shading does not require duplicate ...
1
vote
1answer
325 views

How do I make an object not appear grey regardless of distance? [closed]

My moon texture is on a plane 500m away and I would like to know if there is a way to keep displaying the texture: As opposed to it turning grey as pictured here: regardless of the distance it is ...
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
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
0answers
82 views

Half-shaded pixel artifacts on 2d dynamic lighting shader

I'm working on a shader for dynamic lighting in a 2 unity game. I'm new to shaders but I've managed to get something close to the effect I was looking for, although not 100%. As you can see in the ...
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: ...
20
votes
7answers
8k views

Modern Shader Book? [closed]

I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about ...
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
73 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
56 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 ...
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 ...
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. ...