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

Is there WaitForFixedUpdate in CGProgram Code?

is it possible to make a loop counter that skips frames in cg? i.e. i++ every next frame?

View Article


Shader - Object Depth

I would like to retrieve the depth of an object but in a *normalized* way, I mean not dependant to the camera distance. I know that it's possible to retrieve the depth of the scene and with a shader...

View Article


How do you change Point Size in Direct3d 11 shader?

I'm rendering a point cloud using MeshTopology.Points. I wrote a simple vertex shader that can change the point size during play and that worked fine until Direct3D 11. I have to use D3D11 because I'm...

View Article

Grabpass refraction masking

Hey everyone, I am trying to solve the grabpass front object issue with some depth masking but I am facing some difficulties in forward rendering. Here are some interesting parts : Code (CSharp): //...

View Article

How can I read in the actual elements from an Append Compute Buffer?

I have a Compute Shader in my game that runs every FixedUpdate() call. It has two passes/kernels: 1) clears out an Append buffer by "consuming" every element 2) appends several new elements into said...

View Article


Unity5 shaders and loop unrolling

Hi So Im doing volume rendering in Unity5 and I have a simple ray casting shader, Im able to put the number of loops to ~400 but it takes 10-20 minutes to compile as the shader unrolls the loop. It...

View Article

Converting GLSL Shaders

I have found a GLSL shader which I would like to convert to Cg/HLSL so I can use it in Unity5. Can someone lead me to a decent site that would explain how I do this change or if someone can explain...

View Article

Access to svPosition in fragment shader

I am trying to access to the svPosition in my fragment program in Unity but I keep having this error. invalid input semantic 'POSITION': Legal indices are in [1,15] invalid ps_3_0 input semantic...

View Article


[Compute Shader] Pixel Data from Texture Coordinates

I have an HLSL shader where I want to access neighboring pixels, get their color (float4), and do some averaging to create a blur effect. Where color is assigned is the problem spot. Instead of getting...

View Article


Compute Shader Pass RWStructuredBuffer by Reference

I was curious if there is a way to pass a structured buffer around by reference. With both structured buffers and arrays I don't want them to be copied entirely when passed to a function, because this...

View Article

fragment shader different color for every vertex?

can i make different colors fore every instance of this shader? do i have to send instance to o.output or something? how can i do it? StructuredBuffer buf_Points; StructuredBuffer buf_Positions; struct...

View Article

Using Texture2DArray as RenderTarget and passing data to fragment shader

I'd like to render multiple views into an array of 2D textures, then pass this array into a fragment shader for processing. Imagine a stack of differing 2D viewpoints of the 3D scene, where on the 0th...

View Article

No acceptable conversion when converting cg shader to glsl

I have a simple shader where at some point I perfrom logical operations component-wise between boolean vectors: float2 x_ = ( (x >= 0) && (x < a) ) ? float2(0., 0.) : float2(0.5, 0.5);...

View Article


Exporting graphically created shaders in Visual Studio to Unity. [.glsl to...

Hello. Can I export Visual Studio “.glsl” shader into Unity? Visual Studio has a great tool for creating Shaders, but it cannot be converted to Unity Shaders, just “.hlsl”, “.h”, “.cso”. .glsl to .shader

View Article

Moving UV's with a shader (tiling error)

With the following code I tried to animate a texture on a surface by moving its uvs. However it moves, but it doesn't tile correct as the net tile is just grey (stretched from texture's border). Now...

View Article


Custom shader samples pixels per-texture rather than from the screen

Hi all, Thanks for reading (and sorry if this is a bit wordy), I've had a Google and a think on this but can't seem to work out what's happening. I'm new to shaders and after a few tutorials have...

View Article

HLSL clip() function don't work on Adreno 320

HLSL clip() function don't work on Adreno 320 (for example Nexus 4) GPU if compile with Unity 5.3.5 or newer. On Adreno 330 (f.e. Nexus 5) works fine compile on any version, but on Adreno 320 works...

View Article


Shaders don't work properly on android

Hello, I am working on a way to create high resolution screenshots of a tilemap on android in order to achieve this i am manually drawing the image using GetPixel/SetPixel, and subsequently i am...

View Article

How can I make a shader pass that emits dynamic light?

I have been reading the docs and searching around on google for a few hours, so I doubt there is an answer on this website, but if there is, please answer with a link. So, back to my question, I have a...

View Article

How to use SampleGrad in Unity shader

The code in hlsl but I can't use it. Unity says "sampler2D object does not have methods" There's the detail [SampleGrad (DirectX HLSL Texture Object)][1] The article relate to [A Closer Look At...

View Article
Browsing all 206 articles
Browse latest View live


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