Quantcast
Channel: Questions in topic: "hlsl"
Browsing all 206 articles
Browse latest View live
↧

"Floor" function produces artifacts in shader

Hello everyone, here is the output of the simple shader **tex2D( myTex , floor(i.uv*3)/3);** I need to do this to get a coherent noise from sampling an image. How can I avoid the flickering artifacts...

View Article


Unexpected identifier cbuffer error

I have a hlsli file and would like to port it into Unity. However, it seems something wrong that Unity does not recognize some keywords such as "cbuffer", "textureCube", "texture2D". The following is...

View Article


Cross-project shader support

I have one project with some vertex shaders that I am working on. I recently discovered need to add a geometry stage to the shader. As soon as I add the '#pragma geometry xxx' (or for that matter...

View Article

Setting hlsl buffer value from c# code?

Hello, I've been working on porting a 3rd party image effect hlsl shader to Unity and I have a buffer to set for the shader to work correctly. Buffer _bSamplePattern : register(t2); My question is, is...

View Article

Porting from ShaderToy(GLSL) to shaderlab(HLSL/CG) unity not giving me the...

I came across this beautiful [shader][1] from [shadertoy][2] which I am trying to implement in Unity. I managed to get the blur box background and also the random dots get generated. But I am not able...

View Article


What is the cost of ComputeShader.SetBuffer

I would like to know if ComputeShader.SetBuffer has any overhead. I have a ComputeBuffer that I want to share between kernels since its rather large and I will need to set the Buffer for each kernel...

View Article

ComputeShader: Accessing array elements within a StructuredBuffer

I have been toying with ComputeShaders for a while now, and have been trying to use them to leverage the hair physics calculations I was doing in my game. The hair is based off a series of points that...

View Article

Reuse vertices modified in a previous shader pass

I've recently started to learn shaders and I'm trying to write a shader that : - Animates a mesh to simulate water waves ; - Reuses the standard Unity shader so that I don't have to write all the...

View Article


converting HLSL to GLSL.

@atomicjoe Can you please explain how HLSL to GLSL worked for you? ( github thread)

View Article


How to prevent shader optimizations?

I was testing shader instruction performance, and to make results more clear i made a loop, and unrolled it.[unroll] for(int j = 0; j < TEST_COUNT; j++) { col = tex2D(_MainTex, i.uv.xy); } But...

View Article

2D Perlin Noise in C# and HLSL

I am currently working on Shaders and since there is somehow no useful intrinsic perlin noise function, I decided to use [This][1] library or more specific the [cnoise][2] function. The problem is that...

View Article

How to setup a custom screen post processor with multiple passes.

I'm trying to do my own custom shader for a blur which I then just add to a camera as a component. First blur pixels horizontally and then vertically (2 passes). But I can't seem to find any...

View Article

A question about UVW.

Hello, everyone. I'm working on volumetric clouds, and i've ran into an issue i'd like to know more about. So basically i use a compute shader to generate a 3D noise texture. It doesn't really matter....

View Article


CustomRenderTexture Starter?

Hi All, I'm trying to wrap my head around custom render textures. All I want is a simple example of setting it up (e.g. what connects to what). The docs have failed me (or vice versa?) Here's what I...

View Article

Mathf.Repeat in ShaderLab?

Hello, i looked around but couldn't find a shader intrinsic function that does what mathf.repeat does. Do you know if there is one?

View Article


Builtin Shader UI/Unlit/Transparent Yellow Pixels Read As White

Hi All, I'm using the builtin shader that comes with the Unity UI found at UI/Unlit/Transparent. When I read then write (without changing any pixels) the texture it makes yellow pixels become white. Is...

View Article

Chaining Multiple Shaders Together

Hi, 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...

View Article


tangent space viewDir in a SurfaceShader

There is probably not much more I can say about that. I'm trying to get the tangent space view direction in a surface shader (in the surf() function) but I can't seem to figure out how, so after...

View Article

weird values from UnityWorldSpaceLightDir

Hey, ran into what I guess to be an issue with UnityWorldSpaceLightDir. When I pass the vector into a fragment color I get this unexpected popping. https://imgur.com/vG3t3I3 ![alt text][1] Seeing the...

View Article

Has Unity 2018 removed DX11 quad tessellation?

I have been working on a volumetric lighting project and I use DX11 quad tessellation to create a 3D volume mesh. I use Commandbuffer.DrawProcedural and call it using MeshTopology.Quads with some...

View Article
Browsing all 206 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>