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
2answers
91 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
75 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
42 views

Wrap texels between desired values

I'm using a basic pixel shader here ...
0
votes
0answers
172 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
69 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
46 views

Perfect Tiling for Photos of Floors and Walls

I am trying to design a realistic 3D environment from photos, where by means of a photo of a portion of a wall or floor, you can clone this photo and create a complete wall or floor. However, when I ...
0
votes
0answers
59 views

Unity shader pixelated on Android/ WebGL

I'm writing an image effect shader that should display an overlay texture on the screen using the following code in the fragment function: ...
0
votes
0answers
107 views

Implementing a wobble effect for speech bubbles in Unity?

I'm working on a little game in Unity 3D and I'd like to replicate the wobble effect seen on the speech bubbles in the game "Night in the woods", as seen here: https://www.youtube.com/watch?v=...
0
votes
0answers
472 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
419 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
319 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
422 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
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 ...
0
votes
1answer
220 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
559 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
577 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
109 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
125 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
23 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
120 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
249 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 rendere working fine but unfortunately its display is not according to my ...
0
votes
0answers
60 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
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
166 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
148 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
71 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
108 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
371 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
196 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 ...
0
votes
0answers
127 views

Chaining Multiple Shaders Together (Unity)

this is probably a really stupid issue, but I just don't know how to do it I have shader A: This one does pixel lit sprite shading. It's a cs file that just includes a ton of cgcinc files then I have ...
1
vote
1answer
285 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
26 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
116 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
122 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
52 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
358 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
79 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 ...
0
votes
0answers
3k 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
561 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
93 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 ...
0
votes
0answers
56 views

Load normal-/bump-map data into shader with libgdx

I'm currently applying shaders and want to create bump and normals maps and access those data from my shader. How do I load these separate textures/images into the shader though? Currently I just ...
0
votes
0answers
96 views

What would be a good worley noise feature point function?

I read through various introductions on worley noise and couldn't find a good definition for its feature point generation function. For example there is the book of shader's worley example, and they ...
2
votes
0answers
231 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
144 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
0answers
113 views

Custom sprites for NeonShader - Unity

I'm currently working on a simple game and want to add neoncoloured sprites to the environment. For this purpose I searched for similar effects and found this. I tried using the shader and could get ...
1
vote
2answers
886 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
42 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
56 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
514 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
143 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 ...