Questions tagged [shaders]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
47 views

How to store shader output to VRAM?

This is really ungrateful question to Google. Basically, I would like to know, regarding openGL, what are various methods to do some kind of computation in one of the shaders and have the results ...
0
votes
1answer
3k views

Unity LWRP & Projection Shader

I recently added the Lightweight Render Pipeline to my project as I'd like to start experimenting with Shadergraph to see if I can get a better basic understanding of shaders. Everything has gone ...
1
vote
2answers
130 views

Combining multiple diffuse textures into one leaves strange distortions?

I made 3 models, each has own material. And after texture painting, I combined each their texture to single textures for optimization. Currently making Mobile Game with Unity 2018 and using Mobile/...
1
vote
1answer
147 views

Does texture splatting always sample 4 x N textures per fragment (regardless of the weights)?

Texture splatting - usually - is done by vertex painting, where each channel R-G-B-A is assigned as a different texture weight. Due to the way shaders are executed, doesn't it mean that the fragment ...
1
vote
1answer
72 views

Wrap texels between desired values

I'm using a basic pixel shader here ...
0
votes
0answers
300 views

Computing depth from position of fragment in world space

I have a raymarching shader which computes the location of a hit on the scene in world space. float3 worldPos = ... ; I can verify that the world position is ...
0
votes
1answer
82 views

Why is clip-space 3 dimensional?

A vertex shader is basically a transformation function that converts a vertex in your world space to a space that can be rendered on screen. Since the screen is a 2 dimensional surface whats the ...
0
votes
0answers
781 views

Amplify Shader for mobile

I'm recently learning Amplify Shader to make shader more easily. It's visual shader editor for Unity that allows to create shader by connecting nodes. Right now I need a shader for Android project ...
0
votes
1answer
953 views

Emission for Mobile Shaders?

I need to use Emission texture to my model, but I can't find any emission parameters in mobile shaders. I searched this on google, but there's nothing helpful to me. How do I add emission for mobile ...
1
vote
1answer
784 views

Additive, Alpha Blended, Unlit, Lit differences?

Short question, what's the difference between the shaders used for particle, and how they affect the visual. Additive Alpha Blended Unlit Lit
0
votes
1answer
807 views

How to do “realistic” plastic material?

How can i do "realistic" plastic material in Unity 3d , using standard shader or other shader ? Can you suggest me options ? Thanks
0
votes
1answer
2k 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 ...
0
votes
1answer
470 views

Unity Surface Shader Using “worldNormal” While modifying Normals Turns Shader Black

So I was writing a simple triplanar mapping shader and while doing so encountered a bug where when using IN.worldNormal in code while writing to ...
1
vote
1answer
860 views

How to create a 2D fog shader?

I am trying to write a fragment shader in GLSL for a fog effect in a 2D game. Here are some links showing what I'm after. Here the fog is in the foreground and near the ground: https://twitter.com/...
1
vote
1answer
1k views

Dissolve object starting from the bottom

I'm currently getting into using the new "Unity Shader Graph"s and have made an OK dissolve shader that looks like this: My next goal is to move this effect so the object dissolves bottom-up. This is ...
1
vote
1answer
150 views

Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

I'm very new to graphics programming, and as I understand it vertex shaders are called per vertex and fragment shaders are per pixel (ignoring anti-aliasing). When it comes to optimization all sources ...
0
votes
1answer
190 views

Tilemap shader confusion

I am trying to setup a system for utilizing uvs to tile a texture and reduce draw calls. I'm using Unity. I create a texture which records the x index of the tile from a tileset into the red channel ...
0
votes
1answer
42 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 ...
1
vote
0answers
193 views

Unity Pink Texture On WebGL

I'm trying to follow a youtube tutorial for my new game(images puzzle) and by using it's implementation on github to upload it later on facebook. When I run the game inside unity editor its work ...
3
votes
1answer
336 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
105 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 ...
4
votes
1answer
252 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
251 views

Is there a way to convert a shader code to shader graph?

I would like to ask if there is a way to convert a Coded shader into the new Shader graph, beacause i want to edit my shaders in more efficient way. Any help is appreciated.
1
vote
1answer
164 views

Separate game engine from game

I'm building a simple game engine (or mostly rendering engine) and I would like to separate the "engine" part from the "game" part. So, I've come up with an idea to build "engine" part as a library (...
1
vote
1answer
129 views

GLSL shader time uniform freezed?

I have a simple fragment shader to simulate "falling water". I'm using Ogre3D and opengles2, this is my code: ...
0
votes
1answer
214 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 ...
1
vote
1answer
658 views

Old tv effect in shader graph

I am trying to use Unity's shader graph to create this old tv effect: I thought about using a noise node, and somehow randomize the noise's seed. Can anyone help me?
2
votes
2answers
439 views

Sobel Edge Detection on Depth Texture

I'm currently trying to implement contour shading via edge detection on a depth texture. I'm rendering the color and depth information onto two textures. In my post processing shader I do the ...
1
vote
1answer
424 views

Lava flow shader with Shader Forge in Unity

I am just starting with shader programming and after reading a bit, I tried creating a shader that is simulating the flow of lava on rocks. Got a placeholder rock texture from internet and everything, ...
0
votes
0answers
32 views

Make a object render behind/trough another but make hide it if its behind some other object

So first of all sorry for this strange title... I know it may sounds worse and a bit complicated... But heres my problem : My player belongs to the "Player" layer. He stands somewhere on my map, ...
2
votes
1answer
181 views

Cutout fragment shader pixels arent square

It has been solved, link to the final shader: Shader The problem (as portrayed by the image below) is that the pixels seem to be, for lack of a better word, cut off. I wish to either display a pixel, ...
1
vote
1answer
139 views

Unexpected lighting on cube

I am following a tutorial for 3D game development in Java, using LWJGL. I have completed all chapters up to chapter 14 - Terrain, inclusive. The tutorial is in Java, but I'm using Scala. My full code ...
0
votes
1answer
73 views

CompileFromFile syntax error upon compilation

I am using visual studio c++ 2003 edition and I am trying to use the function CompileFromFIle function from DirectX SDK February 2010 SDK to add bloom to my source code for a mod I am working on and I ...
2
votes
0answers
589 views

In Unity's Shader Graph how do you access parameters from code?

I recently rewrote a shared I was using into Shader Graph. As an example I carried out the color as an external parameter. In my traditional shader to set the color I would call something like ...
2
votes
2answers
88 views

Which part of the rendering pipeline compiles shaders?

Generally, video games and other graphical software that use vertex and fragment shaders will have said shaders in the form of actual shader source code (typically in glsl or hlsl), and will compile ...
1
vote
0answers
5k views

Is there a way to convert shader graph to shader code for older version?

Editing Shader in a graph is brilliant feature, however it's only works in Unity 2018 with Lightweight RP template. So I want to use the shader made from shader graph in Unity 2018 to older versions, ...
0
votes
1answer
1k views

Correct way to project a texture with alpha and colors onto surfaces in Unity

I am experimenting with Unity and wanted to project a unit circle beneath a unit and my very first naive approach was to create a child plane below the unit, assign the material to it and stretch it ...
2
votes
1answer
147 views

OpenGL Outlining Cubes in a Greedy Meshed Mesh

So I've managed to get myself a greedy meshing algorithm implemented for a little voxel game I'm developing to teach myself LWJGL/OpenGL, and it's going great. The thing is, I don't plan on using ...
2
votes
0answers
260 views

Fog of War in Unity

I know that my question will not fall into the type of questions normally asked here (no coding presented). I just need some tips and advise on how to proceed (e.g. pipeline or something). I'm making ...
0
votes
1answer
149 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 ...
1
vote
2answers
2k views

Unity Shader Graph, set blackboard properties from code

I have a Shader Graph shader with a blackboard property that I want to change from within my code. The property is called Highlight here are the things I have tried:...
0
votes
0answers
56 views

Render problems (black, purple and blue effects) in old GPU and Unity3D 5.6 project on Unity 2018

Well, I have a PC that has a GPU from 2009, and now I have some problems with a fork. The project was on Unity 5 (2015) and I have upgraded it to Unity 2018.1.0, without any problems. But some times,...
0
votes
1answer
84 views

Opengl Postprocessing draws only white

I'm currently trying to implement post processing into my project. First I configure my framebuffer: ...
0
votes
1answer
1k views

Using a Compute Shader in Unity to convert a texture to a float array

I have a fairly simple requirement for a compute shader (DirectCompute through Unity). I have a 128x128 texture and I'd like to turn the red channel of that texture into a 1d array of floats. I need ...
2
votes
2answers
231 views

What are “free vertex indices” in WebGL 2 and how do they relate to geometry shaders?

In January Notch tweeted about WebGL 2: WebGL 2 is happening. Bye, compatibility! Hello, 3d textures and pixel buffers! oh god it's got free vertex indices in the shader. That is basically a ...
1
vote
1answer
1k views

Surface Depth Intersection Shader

I recently asked a question about the creating an accurate Depth Intersection Shader. When creating this in a fragment / vertex shader it could be achieved by the following code ...
6
votes
1answer
2k views

How to write a transparent shader for a sprite that ignores transparent sprites behind it?

I have multiple UI Sprites that have their alpha set so you can see what's behind them. I would like to make these UI Sprites ignore other UI Sprites. So take this first picture. There are 4 UI ...
1
vote
0answers
479 views

Shadow & sorting issues with vertex colored PBR Shader Graph

I'm working on a custom shader using Unity 2018's new shader graph feature. Previously, I was using this shader, which worked great for awhile, but it ended up constantly breaking for seemingly no ...
0
votes
0answers
206 views

How can I achieve a 'warm' scene in Unity using post processing effects?

I've recently fallen inlove with this Cozy Tavern scene by Beholder, and am looking to replicate it's feel the best I can in unity as a learning exercise. A lot of the scene's depth is added through ...
2
votes
1answer
3k views

Depth Intersection Shader

I am trying to create a shader in Unity that shows where intersections occur between objects. Most of the shader I have so far is based off of this youtube tutorial. However, I have made some slight ...