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
11 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
12 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
33 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
16 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
16 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 ...
0
votes
2answers
116 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
21 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
15 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
88 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
52 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
15 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
56 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
45 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
26 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
59 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
24 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
30 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
0answers
42 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
33 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
26 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
33 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
44 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
29 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
51 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
99 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
vote
0answers
33 views

How to have a point light with no falloff in Unity 3D?

Does anyone know of a good strategy to make point lights with no falloff, eg. anything in the radius of the light will be 100% illumination while anything outside the radius will be 0% illumination. ...
0
votes
0answers
47 views

How can I modify the transparency n the shader?

I'm learning how to use transparent surfaces. I am using a texture with black background, but any change in transparency is not showing, what I am doing wrong? Here is my shader code: ...
1
vote
0answers
40 views

How can I unpack texture data following a 16 * 8-bit pattern?

Is possible to unpack texture data following a specific bit packing scheme? I have read that texture data in HLSL can be read in as 4 floats of 32 bits each totaling 128 bits. The packing scheme I'm ...
0
votes
1answer
56 views

Only one triangle drawn

I am trying to render a quad with gl render mode GL_TRIANGLES with using element array buffer. Here is some code to explain process. Only the first 3 elements of indices array are drawn as expected. ...
0
votes
0answers
14 views

How to debug shaders running on Android 4.x devices?

I have tried some of the existing inspectors such as RenderDoc and gapid, but none of them can be used with Android 4.x. Latest version of gapid requires Android 6.0 and RenderDoc requires Android 5.0....
0
votes
1answer
39 views

Unity Shader Blend like ugui Outline

Unity UGUI Outline it create fourfold vertexs, So I wirte shader to optimization ( vertex only create once ), And I want to Keep one pass . (one drawcall) There ...
0
votes
0answers
23 views

Rendering part of an equirectangular video on a plane

For a Unity project I have a 360 camera which produces an equirectangular video. I need to realize preview of this video for putting it on a plane. In most cases the part of the video to be drawn on ...
0
votes
0answers
25 views

SharpDX (DirectX11) Weird depth behaviour creating pixel error

I'm trying to render a simple terrain but I have a problem with the rendering result. The "blue" (it's the backbuffer clear color) pixels are the ones that I don't know where they come from. The ...
0
votes
0answers
42 views

Logic behind a cubic reflection

I'm creating a cube in WebGL made of mirros that have to reflect the object inside of it. At the moment I'm stuck because I don't understand the correct logic to implement to achieve the result. I ...
0
votes
0answers
23 views

Do I have to write #pragma multi_compile_fwdbase in ShadeLab?

Recently I met a problem that if I don't write #pragma multi_compile_fwdbase then the shadows will never be shown. However, if I don't want shadows, it's ok without ...
0
votes
0answers
53 views

Simple water reflection is going wrong

i added simple code to my water shader that should add reflections of objects above the water line. The problem is that the reflection is only correct when the camera is in a certain angle to the ...
0
votes
1answer
62 views

Standard Unlit shader doesn't work?

I created a project to download and try out free Unity assets. I then transfer the assets I actually want to use to my actual project which uses the LWRP render pipline. I tried to get some particle ...
0
votes
0answers
7 views

To extract Grabpass image as texture2d via script

We applied it to the plane object using Grabpass. I want to import the image shown in plane through script. I want to make the imported image in texture2d format. Is there a way? Below is the relevant ...
0
votes
0answers
30 views

Convert Rainbow gradient Shader to 3 colors gradient

I am attempting to convert this rainbow shader into just using three colors. I thought I would be able to set the three colors in the shader file, but I can't understand how to link them through the ...
1
vote
1answer
98 views

How to use a sprite mask or shader to mask a text?

I'd like to know what I need to learn to apply a shader to achieve masking on the text. Here is my text object in-game, I'm using a sprite mask to mask the game objects on the card, they're all in ...
1
vote
1answer
41 views

How can I clip my sprite as it passes through a portal in a 2D scenario, using OpenGL?

This is a very simple question, but after a brief search and reading through the "similar questions" I could not yet find an answer. I'm creating a 2D game using OpenGL and came across a problem: Let'...
0
votes
0answers
29 views

Cross section shader for box bounding using amplify Shader in Unity

I am trying to create shader through amplify shader for a cube to cut through plane or any mesh when cross section. I know that I should be using size, rotation and position for that but what exactly ...
0
votes
1answer
31 views

Add single color background to texture using shader

I want to add a single color background to my texture. In my case, in Unity UI, I can simply create two Image components, one on top of another, and use the one on the bottom as a single color ...
1
vote
0answers
34 views

How to make a Material that looks like a sun

I am trying to understand material and shaders in Unity. I would like to make a material to attach to a sphere, and make it emit light like a sun. For the moment I do not care if it's not looking ...
0
votes
1answer
23 views

How to access random material in a renderer besides first without cloning any materials except accessed one?

Clones only first material: renderer.material Clones all materials in the same renderer: renderer.materials[0]
1
vote
0answers
70 views

Procedural sketch / painting shader

So after some google searching apparently I don't even know what this technique is specifically called: I'm trying to figure out how to create an effect in unity that 'paints' a 2d asset on screen. ...
0
votes
0answers
165 views

Unity - Shader Graph not displaying preview in HDRP

I'm working on a new project (Unity 2019.2.4f1, HDRP). I made my first PBR shader and it works correctly when applied to a material, but it doesn't display anything on the Main Preview in the Shader ...
0
votes
0answers
24 views

How to create a fog for baclgro6 which works on mobile devices?

There is a forum entry, which explains how to create a high based volumetric fog, using soft particles ( How can I create a height-based volumetric fog? ). Unfortunately it doesn't work on mobile ...
0
votes
2answers
109 views

HLSL - Shore fading in a water shader

in my desperation while trying to achieve this (I am a HLSL noob) i try to ask my question here. I am modifying an old water shader for the game "MTA San Andreas" (the multiplayer modification). MTA ...
0
votes
0answers
45 views

How to get depth buffer from PUBG?

I have no any experience in game development, I'm doing some research on machine learning tasks and for my project I need to know how to get depth buffer. I tried to google but haven't found relevant ...