a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

learn more… | top users | synonyms (1)

1
vote
1answer
16 views

How can I pass a texture to a custom deferred lighting model in Unity?

I've replaced the Internal-DeferredShading.shader with my own shader, and it's working fine, but I want to add a uniform texture for it to sample from. I've tried adding a texture as a property and ...
1
vote
1answer
36 views

Disney BRDF - where is metallic factor input into BRDF?

Burley states about metallic parameter: "This is a linear blend between two different models. ..." What are the two models? I can't see this described in the Frostbite or the Unreal papers either. ...
2
votes
0answers
22 views

Simple square vertex lifting shader

I am trying to rebuild the fur effect in Viva Pinata. Here each square becomes a pattern of fur I imagine the process to be like this... U lift one end of the triangles. Now I need to ...
1
vote
1answer
123 views

Making Cave system in Unity 5

I know there are many threads about this but none of them seems to work for me and I spent like 2 days already on that problem. Things that I've checked: http://wiki.unity3d.com/index.php/...
3
votes
1answer
56 views

How do I pixelate a scene with SceneKit and Metal, in Swift?

I managed to get pixelation working by using the OpenGLES2 rendering API, and a CIFilter. But it was way too slow, so I want to use the Metal API and just have a very simple filter that pixelates ...
1
vote
1answer
31 views

Check if vertex is visible in shader

Im trying to figure out when a vertex is visible from the main camera. I have this function: bool in_frustum(float4x4 M, float4 p) { float4 Pclip = mul(M, float4(p.x, p.y, p.z, 1.0)); ...
3
votes
1answer
51 views

Per-Texel lighting? (not per-vertex or per-pixel)

In my game, I have a 3D shader that does lighting using color ramps on models with very low resolution textures. Basically, the vertex shader calculates color values for direct light and ambient ...
3
votes
0answers
19 views

LibGDX: Shader files in assets - Access is Denied

I stored the glsl files in android -> assets -> shaders directory, but when I run the app, an error is displayed: Error:Gradle: Execution failed for task ':android:mergeDebugAssets'. Error: ...
1
vote
2answers
58 views

How to write from shader to a texture to a PNG in Unity?

I want to write the information from my shader into a texture and save it in a png. I found this: http://forum-old.unity3d.com/threads/save-texture-generated-by-a-shader.326561/ and this System.IO....
1
vote
1answer
27 views

Unity / Passing an array in a shader

I want to pass my array (which is inside my c# code) to my shader. Shader "custom/shader4" { Properties { _myArray("Array", Float[256]) = [] } SubShader { Pass ...
0
votes
1answer
37 views

Unity / How to add a shader to a material via c# script?

I found already some things - but those seem not quite what I need. (perhaps outdated functions?) https://docs.unity3d.com/ScriptReference/Material-shader.html here, it seems you can add a shader to ...
3
votes
0answers
67 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader #version 450 core layout(triangles) ...
0
votes
0answers
38 views

Unity / How do I change the color of the “Screen” based on the Object's depth's (as a Screen Effect)?

Yesterday I asked and solved my problem: Unity / How do I change the color of an object based on its depth? Today I tried to change the script(from yesterday) and apply it to the camera and it did ...
0
votes
0answers
19 views

Unity fragment shader. Problem with passing parameters to shader in android version

I have a shader linked to a material which is connected to an object. On runtime I'm trying to change it's parameters( with uniform variables or with properties). On my PC version everything works ...
0
votes
1answer
71 views

How can I duplicate this color/hue shifting effect in C#?

I am looking for a way to duplicate this color shifting effect: I don't think it matters but the starting frame would be this: My instinct was that some type of hue shift is occurring in a way ...
0
votes
1answer
91 views

Unity / How do I change the color of an object based on its depth?

The objective here is to change the color of the nearest object. (the nearer the object, the more "colorful" the object gets rendered; and the farther away, the more "grey" the object gets rendered), ...
1
vote
1answer
57 views

OpenGL nothing being drawn to screen

I am following the book 'OpenGL SuperBible' and am trying to run one of the first examples of drawing a point to the screen, bit instead of using there lib, im using GLFW. I'm not sure where I am ...
0
votes
0answers
9 views

LibGDX Render Mesh

I have a Mesh mesh. I'd like to render mesh. However, its method for doing so is render(Shader shader, int primitiveType). I don't have a shader. To get a shader, the thing to do is new Shader(...
0
votes
0answers
14 views

Unity VR: Possible to render a multiple mesh/material model transparent without seeing innards?

I would like to render a model in VR using Unity. This model consists of multiple meshes, some with different materials. I would like this entire model to fade in and out without having depth sorting ...
1
vote
0answers
18 views

Multi Sampling in Rendering Pipeline?

I am trying to understand : How does multi-sampling rasterization effects pixel shader output? In a nutshell (i am skipping some steps to stay on point of question): Vertex data is fetched. Vertex ...
1
vote
0answers
35 views

How do I mask a height based fog?

I've been trying to implement a 3D (with the Y axis being utilized) fog of war system similar to what XCOM uses. There is only one hint that really seems to nail it, but I can't read the actual ...
0
votes
0answers
28 views

Lens Distortion not working with Unity 5.3.5

I have downloded the latest sdk from this link https://github.com/googlevr/gvr-unity-sdk I imported the package into my project.From the prefab added GvrMain to my scene and set the Distortion ...
6
votes
2answers
142 views

Is there a way to make the boundary between materials wavy?

I have a sea trading game that I'm working on developing. Right now, my world looks like this: There are 4 different "biomes", with more to be added. Internally, this is a large mesh which has 4 ...
1
vote
0answers
24 views

Models keep turning white - Unity 5.3.5p1

I'm using Unit 5.3.5p1 but for some reason my models randomly turn white after I build an exe to run outside the editor. The textures work perfectly fine within the editor, but as soon as I build and ...
0
votes
1answer
21 views

XNA HLSL Shader Color Swapping based on lightness

I'm trying to achieve a similar effect to the image below in HLSL. [Ignore the inbetween state, currently I'm only trying to achieve the final phase, which is black and red] What I tried so far is ...
1
vote
0answers
20 views

Keeping a mesh entirely at the GPU and changing its vertices there with a ComputeShader (Unity5)

In a Unity game I have an object whose mesh is made of around 10k vertices and I have to make changes to these vertices (position, color, etc) almost every frame. Considering that such object is ...
2
votes
1answer
65 views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen but an unable to using the Projection, View and Transformation Matrix's but an unable to get anything to the screen. Main loop ... ...
0
votes
0answers
25 views

Frustum Culling behaves incorrectly with vertex shaded objects

I have a scene with a straight path. It looks something like this: I've also wrote a vertex shader that bends the path. After applying the shader, it looks something like this: If you were to ...
-1
votes
2answers
121 views

What is the most efficient way to render water?

Would I create the water surface mesh in C++, and control the movement/animation in the CPU, and afterward apply any shaders (reflect/refraction/caustics/etc..). Or should I only create the mesh in C++...
1
vote
0answers
17 views

Simple coherent noise function to use in a GLSL shader

I'm looking for a simple (but especially fast) coherent noise function to use it in a shader written in GLSL. I don't need it to be excessively smooth or good looking, I just need that it has the ...
0
votes
2answers
30 views

What does this shader error in Löve2D mean?

What could I've done wrong to get the following error message when trying to create a GLSL shader in Löve2D? I'm sincerely clueless of what the mistake could be, though I suspect the error being a ...
0
votes
1answer
54 views

How to calculate 2D viewport coordinates in a shader?

In Unity, I use the following shader to calculate 2D viewport coordinates : Shader "Foo" { SubShader { Pass { CGPROGRAM #pragma vertex vert ...
1
vote
1answer
49 views

Unity Surface Shader: Conditinally noforwardadd

I'd like to have this in my shader: #if SHADER_API_MOBILE #pragma surface surf Lambert noforwardadd #else #pragma surface surf Lambert #endif But this tries to compile both #pragma surface and ...
0
votes
1answer
38 views

HLSL SetVertexShader Texture2DArray Sample

I want to do some texture samples in the vertex shader, but it seems this cannot be done in the same was as when using the Pixel shader. The code is basically.. Texture2DArray gTexture; VS() { ...
-6
votes
1answer
66 views

Is this shader can exist in Unity?

'Front' and 'back' are all SpriteRenderer. Do you have a Shader these things that will be present in the Unity?
0
votes
1answer
15 views

unity shader : Applying ZOrder to sprite renderer conditionally

here's scene object info of above figure. all of object's renderer is 'SpriteRenderer', and Material is 'Sprites-Default'. [A (Car)] OrderInLayer : 302 Local Z Position : -9.8 [B (Land)] ...
1
vote
3answers
88 views

Process of writing to the depth texture

In openGL, let's say I output one single point from the vertex shader with this value gl_Position = vec4(2.0,3.0,5.0,7.0); what exact math operations happen to "z" after leaving the vertex shader? ...
0
votes
1answer
30 views

Gaussian blur spritesheet/texture atlas without clipping edges

I'm trying to apply a Gaussian blur to a shadow to soften them a bit. I can apply the blur fine, but the problem is that I end up with this: Instead of this: Which isn't great. The image is part ...
0
votes
0answers
41 views

How do I make an object not appear grey regardless of distance?

My moon texture is on a plane 500m away and I would like to know if there is a way to keep displaying the texture: As opposed to it turning grey as pictured here: regardless of the distance it is ...
1
vote
0answers
17 views

OpenGL ES 2.0 not drawing images with shadows

I'm using OpenGL ES 2 to program a simple game 2D for Android mobile phones. I'm coding the rendering portion of the software, using the GLES20 default library. All my sprites are rendered from a ...
0
votes
1answer
33 views

Unity 5 - Importing models with multitextured materials

I have a file Blender model of a tree. It consists of some branches and lots foliage, nothing unusual. The foliage consists of a single material, which consists of 2 textures, a diffuse and lower ...
3
votes
1answer
54 views

Matte reflection effect in Unity?

I'm trying to achieve that kind of scene but in real time using Unity. It's basically composed of some primitives, a skybox, and a plane. I'm intrigued on how to do this effect in particular: ...
2
votes
1answer
107 views

Why are faces being drawn like this with my custom shader?

I've been writing a custom surface shader which allows for vertex colors (with alphas) to be set programmatically. From test runs of the shader itself, it works perfectly fine, and I am able to set ...
0
votes
1answer
52 views

Why is my custom shader rendering completely transparent?

I'm currently trying to learn how to write shaders, so I'm getting my feet wet with Unity's Shaderlab format. One of the first things I tried was to write a surface shader that supports vertex colors ...
1
vote
1answer
73 views

Rendering issues in Monogame when using shaders

I am currently fiddling with Monogame, trying to work with Shaders and I have encountered a really weird issue. If the first ever draw in the application's lifetime is with a custom shader all further ...
2
votes
2answers
136 views

HLSL texture not reading from register S1

I made a simple post processing shader, that draws scanlines. This all works perfectly. I wanted to make it a bit more interesting by applying a shadowmask instead so I wanted to pass a texture to the ...
1
vote
0answers
25 views

In Unity shaders, how is IN.worldRefl calculated?

I want to know how the world reflection vector in shaders is calculated so that I can manipulate it, but there is no documentation on what it does or how Unity calculates it. How is the reflection ...
1
vote
0answers
25 views

HLSL topology mismatch question

I'm trying to write a fur shader with the shells & fins technique. Currently I receive this DirectX error D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The declared input primitive type in ...
1
vote
1answer
38 views

Implementing my own UI sprite class in Unity using shaders: where and how to position the sprites

For learning purposes, I am trying to implement my own UI classes in Unity "from scratch", in the GPU using shaders. I mean, I am trying to use simple 2D sprites either positioned via shaders or ...
0
votes
1answer
57 views

GLSL - Only draw arond point / flashlight effect

I'm currently trying to achieve a sort of flashlight effect in GLSL. I only want to draw textures within a certain distance of a specified point (the mouse position, for example). Here's a quick ...