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
0
votes
0answers
9 views

Masking a 3d object (Unity)

I have a 3d model of a glass and I want to mask a cube so that I can emulate water filling the glass. Any ideas on how I can do this?
0
votes
1answer
12 views

Unity mesh shader for outlining colour changes

I've written a shader to change colour on a deformable mesh's Z position. This is to create the effect of topographic/contour maps where the colour changes based on the height of terrain of the mesh. ...
1
vote
0answers
22 views

How can I make a shader that renders only the scene's skybox?

I am trying to replicate the following image: There are a few ways about doing this that involve camera stacking, layers, etc. Is it possible to create a shader that will only render the skybox?
0
votes
1answer
20 views

Figuring out the exponent in a spotlight equation from the angle of a cone

I followed a tutorial on how to build a spotlight using DirectX. This tutorial uses a point light equation plus a line of code to limit the light to the shape of a cone. I have everything working, but ...
0
votes
0answers
20 views

Shader Graph, add color outline to 2D Sprite

I'm having trouble creating a shader in Unity Shader Graph (2D) that fills the image from the bottom to the top and adds a color outline along the visible part of the sprite. I can fill the image and ...
0
votes
1answer
38 views

Star glowing shader graph

How could I make a shader graph that makes spheres that look like on this image? I'm new to shaders and I don't know how to do this. Also, if it's possible I would like a property to change the ...
0
votes
0answers
28 views

Unity2D coloring a map

I have an image with a bunch of colored regions, with each region corresponding to a province in my game. Each province also has a nation owner, which has a respective color. I need to create a ...
0
votes
0answers
39 views

Shader works in Editor but not on iPhone

I am using the next script for a painting asset found on this website. As you render the faces of your mesh in the uv space of the mesh, you are reconstruction the islands one triangle at the time. ...
0
votes
1answer
45 views

Unity shader graph: Texturing optimized voxel terrain mesh

I'm new to shader programming, so I decided to use Unity's shader graph for that. I have 256x256 texture atlas(like minecraft) with 4 16x16 block textures aligned on X axis I can successfully assign ...
0
votes
0answers
16 views

Shader intersection radiate outwards

I've been working on a water shader for a project I'm currently working on and have been trying to work on the intersections between objects in the water to create a foam effect that radiates outwards....
24
votes
1answer
5k views

How can I create an exclusive asset for multiple clients who all want basically the same thing?

This is more of a legal question than for example a coding question, but I hope that it's allowed as well. I recently started working as a freelance VFX Artist and do a lot of work with shaders and ...
0
votes
1answer
140 views

Draw onto an object's texture based on a raycast hit position in world space

I am trying to get the world position of a pixel inside a fragmented shader. Let me explain. I have followed a tutorial for a fragmented shader that let's me paint on objects. Right now it works ...
0
votes
1answer
79 views

How should shader be structured? (GLSL)

I've been writing, deleting and rewriting OpenGL programs in C++ but usage of shaders confuse me. I don't know how it should be structured. Scenario A: (In a world we have a sun, the sun should ...
-1
votes
0answers
22 views

Shader /w custom render texture works in the editor but it is black on iOS

I am using some shaders for painting. Everything works fine in the editor and on Android except for iOS. You can see the problem here recoreded on an iPhone 6 - video The object looks ok until I ...
0
votes
0answers
21 views

Gamma adjustment slider implementation

Various online sources talk in sufficient detail about gamma correction. By following them, I achieved a rendering pipeline that looks somewhat like this: ...
0
votes
1answer
39 views

Combining cylindrical Billboarding and aligning with velocity (unity)

I'm trying to make a custom GPU particle solution on Unity to fullfill some needs on my project, using compute shaders and custom shader + Graphics.DrawProceduralNow() to draw them. While I managed ...
-1
votes
1answer
44 views

Render output difference cause

There are two 3D applications compared side by side: I'm looking for difference cause. These might be the cause, but I'm not sure: Color Lighting Shading code (GLSL) ? Can anybody help me with ...
1
vote
0answers
41 views

Projecting grid textures to select parts of the terrain (Unity)

So I'm trying to be smart and not use 500+ some tile prefabs to make a grid, and so far the back-end portion has gone swimmingly. I initially used a dedicated mesh to represent the grid, but as I'm ...
0
votes
0answers
9 views

Test visibility on pre-transposed vertex

I'll preface this by saying I'm kinda new to the whole shaders thing, and I and mostly just trying to learn. What I THINK I am doing in the below pass is extending the vertices along the normal and ...
0
votes
0answers
48 views

Tube model imported from Blender getting stretched vertically when rendering

I'm actually working on a 3D game engine with OpenGL 4 and C++. The problem is that, I don't know why, my geometry isn't well renderered except for primitives. At the right you can see a cube, it is ...
1
vote
1answer
37 views

Back face as pure black with LWRP - Unity

I need to use LWRP in my current project, and I was looking for a way to render the back face as pure black, no lights, no shadows, nothing, just pure black while the normal face would should the ...
0
votes
1answer
36 views

How to apply Image effect only on specific part of objects?

I need a way to censore part of characters' bodies like Cyberpunk 2077.this is mean I want to apply Image effect only to specific parts of bodies that you can see in the below Image:
5
votes
1answer
625 views

How to code shaders in C# without resorting to other programming languages?

I'm working on game and game engine and want a way to prototype shaders. I'm not skilled with C++ or GLSL or HLSL or STH, but I can code in C#. My question is: How can I code shaders in C#, without ...
0
votes
0answers
13 views

Difficulty in understanding how tex2Dlod works

I am new to shader programming. I was just referring to some blogs to learn more on this area. I came across this article https://halisavakis.com/my-take-on-shaders-grass-shader-part-i/ According to ...
0
votes
0answers
30 views

How are objects represented in raymarching shaders

How does one represent geometry in raymarching shader? Say I wanted to pass a tree of SDF primitive shaders. My current idea is to pass texture containing their positions as rgb and type as alpha ...
0
votes
0answers
21 views

How do I get HDRP render enabled so that the shader graph will work

I'm using Unity 2019.2.17 personal, and I imported the shader graph package and created a pbr shader graph. I get a warning: the render pipeline is not compatible with the master node. I assume it ...
0
votes
0answers
24 views

SetTextureOffset in meter per seconds speed

I have this code snippet that faking the tiling offset speed. Now i want to set the speed in terms of meter per seoconds. how to divide or multiply that i get a number which is meter per seconds: <...
0
votes
0answers
64 views

Shader with soft shadows and cel shading

I need help understanding what type of shader can create this type of soft shadow:l, where you can barely see that it is low poly: With standard lit shader you get this type of shading which I rly ...
0
votes
0answers
18 views

Unity Particle not visible inside an object with vertexlit blended shader

I'm developing a game with unity and I'm using a sphere with a texture on it as skybox in my game to fade 2 skyboxes when its the sunset or the sunrise. But my clouds work with a particle system and ...
0
votes
0answers
39 views

Unity Anti-aliased Edge Shader with Variable Thickness (does not require standard shaders or post processing)

I'm trying to create a coloring-book effect for an edge shader (not an outline shader) but having some difficulty creating straight line shaders that don't look badly anti-aliased. (Even before ...
1
vote
2answers
147 views

Add oceans to an earth model with only continents?

I have the following earth model, it only has continents: I wanted to add water but as you can see, some of the continents are now hidden due to the water sphere being more round than continents: I ...
0
votes
0answers
38 views

Unity - Modify basic dissolve shader graph to dissolve from bottom up

I have this dissolve shader made in shader graph which works fine, however I would like it to dissolve from bottom up, how would this be done?
0
votes
0answers
17 views

Shader Only Renders In Left Eye of Head Mounted Displays

I followed a tutorial for creating a geometric grass shader, and the shader works fine. However, when using my Samsung Odyssey+ HMD to view the scene during play mode, the only eye that can see the ...
0
votes
0answers
104 views

Correctly Implementing SSAO

I am trying to implement Normal-Oriented SSAO and i'm having an issue with the results. Portions of the screen are inverted/wrong, typically half way through the screen but not always, it seems tied ...
1
vote
0answers
57 views

How can I apply my camera to all graphics objects?

Is there a way to have the camera be applied to all objects? Can you have the camera effect objects that where made with glVertex3f(); This is the fourth time I ...
0
votes
0answers
19 views

Stencil test doesn't work at all in Unity when I am using a custom shader

I am using Unity 2019.3 and I have a custom shader A which contains the code Stencil{ Ref 5 Comp Equal Pass Keep } And the other custom shader B ...
1
vote
1answer
57 views

Need help with a grab Shader

How can I make grab Shader similar to https://docs.unity3d.com/Manual/SL-GrabPass.html in GLSL. The idea, is that you grab exact pixels from background (ex. from composited renderTarget) and put on ...
1
vote
1answer
84 views

How to change the amount of Fast Linear Gaussian blur in GLSL?

I implemented the GLSL from http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/, but is unclear to me how to reduce or increase the amount of blur. Has it something to do ...
0
votes
1answer
35 views

ToonRamp Shader + Normal Maps: How to keep strict lighting bands?

I'm trying to achieve a shading similar to the one on this image: Image 1: https://imgur.com/a/eTTvSCD To get something similar to this I wrote a toon ramp shader (similar to the one in the Standard ...
0
votes
0answers
64 views

Technique for Edge Detection Between Distinct Entities

I'm developing an application that renders large(-ish) scale graphs (i.e. nodes and edges) in 3D. We've recently been asked to add a flat shading mode, where the graph elements are displayed using a ...
0
votes
1answer
28 views

Simulate Unlit Shader using Physically Base Material Shader

Is there a way to have a physically based material shader look like an unlit shader? Note: this question is not unity specific. I am trying to understand in general if it is possible to maybe(?) set ...
0
votes
0answers
32 views

How to highlight intersection between objects?

I'm new to Unity and I'm developing an augmented reality app. My situation is as follows: I have two objects in the scene, a neighborhood model and a cube. The mockup will be the object I am going to ...
0
votes
1answer
51 views

Reconstructing Position from Depth - Inverted Y?

I am currently trying to understand the following wierd result. This is basically from deferred shading in monogame/XNA. For Comparison I also write the ViewSpace Position in a Buffer and the ...
0
votes
0answers
35 views

How to make the intersection area of sprites transparent if they have the same color?

There are several sprites of shapes in different colors. I can move these shapes. When I move them, I want the intersection of two shapes of the same color to become transparent. As far as I ...
0
votes
1answer
48 views

How can I skew a SpriteRenderer in an animation to grow a side and decrease the opposite side by the same amount?

I am interested in the maths and maybe the shader code. I am almost sure that this would be a great starting point but I do not have any knowledge about shaders and the language they are written in. ...
0
votes
0answers
40 views

Optimizing texture fetches with higher mip levels

Let's say I have some shader program in DirectX or OpenGL rendering a full screen quad. And in a pixel/fragment shader I sample some huge textures at random texture coordinates. That is one same ...
0
votes
0answers
46 views

Compute normal based on Voronoi pattern

I am applying a 3D Voronoi pattern on a mesh. Using those loops, I am able to compute the cell position, an id and the distance. But I would like to compute a normal based on the generated pattern. ...
1
vote
0answers
32 views

Color bands over tile when scaling texture in shader

I want to have tiles with different sprites on the back. Initally I thought I will mix two textures together and then apply mixed texture to game object. I thought that should be easy, but google ...
1
vote
1answer
152 views

Multi pass Surface - erro syntax

I'm trying to make a multiple pass using two [blending] for each one, but he accuses in one place, there is nothing, I don't understand why Parse error: syntax error, unexpected TOK_PASS, expecting ...
0
votes
0answers
113 views

WebGL fragment shader pixel position

I have written a fragment shader, on a shape which is a square made with gl.TRIANGLE_STRIP, and which displays a radar: To build the radar, I'm using distance from ...

1
2 3 4 5
33