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)

0
votes
0answers
11 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
112 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
23 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
16 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
14 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 ...
1
vote
1answer
51 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
22 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
102 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
15 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
47 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
30 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
29 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
63 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
14 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
84 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
38 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 ...
0
votes
0answers
14 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
24 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
47 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: ...
0
votes
1answer
90 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
50 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
65 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
125 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
22 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
21 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
35 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
49 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 ...
2
votes
0answers
37 views

Is there a way to identify, within a shader, the current GPU thread ID?

My question is rather simple: within a shader, is there a way (that works both in DirectX and OpenGL) to retrieve the ID of the given GPU thread being executed at the given iteration? I am using ...
3
votes
0answers
89 views

Particle-system in the GPU in Unity: how to load/store data from/to a texture in the shader?

I have been implementing a simple GPU-based particle system in Unity, for my current game. The setup is indeed not very elaborated: the shader receives a set of coordinates passed trough the position ...
3
votes
2answers
179 views

Bullet holes on curved surfaces and corners

So right now I am making an FPS game where the gun creates bullet holes (plane with texture) on impact, but there is a problem with that, if I shoot at the edge the plane will stick out and also ...
2
votes
0answers
26 views

DirectX 11 - Problem with low resolution decals

I'm trying to add a decal system in my DirectX engine but i'm facing some problems with the quality of the textures projected. Every other no decal texture look fine, but these ones look really bad. ...
0
votes
0answers
22 views

How to apply individual colours in a fragment shader?

I'm trying to write my own shader. Within the target mesh I have assigned the following attributes in a script: mesh.vertices = points; mesh.colors = colours; //Each element of the array hold a ...
0
votes
0answers
38 views

Linear gradient shader ( Photoshop-like)

I'm searching a way to implement a linear gradient shader that behaves as the linear gradient in Photoshop (only the vertical case is necessary). It will be applied to 2D sprites. Currently I'm ...
1
vote
1answer
57 views

How to get color or value from material with shader?

I have a sphere with a shader with colors for specific heights and I want to get the value at the cursor(height) or color of the point the cursor is on when clicked. Is there a good way to get this ...
2
votes
1answer
45 views

Shader only rendering 1/4th of the screen

I've asked the same question on SO here and they suggested I should ask here instead. I'm currently trying to create a gaussian blur shader, and while I've successfully created the blur effect my ...
4
votes
0answers
79 views

Depth of Field Blur - Weighted sampling?

I've been studying Intel's fantastic article titled "An investigation of fast real-time GPU-based image blur algorithms" (here), where-in they state that Gaussian blur would need to be customized for ...
0
votes
0answers
24 views

Low intensity of projector in dark enviornments

I am using light Projector as Headlight for player bike....The thing happening is the intensity of projector reduces in dark environment whereas in normal sunny day projector brightness is proper ,. ...
0
votes
1answer
27 views

GLSL uniform array with size set by another uniform

Will the follwing GLSL code work? #version 330 uniform int size; uniform float[size]; void main() { //do something }
3
votes
1answer
70 views

Upgrading Unity from 5.1 to 5.3.4 has broken game, specifically models made in Blender

I recently decided to upgrade Unity after putting it off for some time as I have a rather sizable project started in 5.1. I knew there would be some hurdles, however, I have had very little luck in ...
1
vote
0answers
39 views

Unity Shader blending colors and color values above 1

I have source images where each pixel is one of exactly 4 colors: red = (1,0,0) green = (0,1,0) blue = (0,0,1) black = (0,0,0) I'm trying to modify Unity's default sprite shader to use those ...
1
vote
2answers
62 views

How to optimize this branching instruction?

I have an outline shader, which samples my texture 8 times to compute the outline. The problem is, that there's transitional alpha values between picture and background. To cut them off I'm using the ...
1
vote
1answer
75 views

When do I need to call `glUseProgram`?

Looking at examples at http://learnopengl.com/#!Getting-started/Hello-Triangle and many different places, I've found that the draw sequence usually goes like this: // setup VBO, VAO, load shaders ...
0
votes
0answers
19 views

How to do an xBR or hqx filter in MonoGame?

I have been trying to implement an HD filter (xBR or HQX) in my MonoGame game project but so far got no success. I have checked out this question, but the shaders provided in the answers don't seem to ...
1
vote
0answers
113 views

How can I create a wind visual effect like Ori?

I'm working on a mobile game in Cocos2D. The game mechanic is very similar to Ori and the Blind Forest's parachute (Kuro's feather) mechanic. I want to be able to render a visual effect for wind ...
1
vote
0answers
40 views

Pixel Perfect Texture Sampling

Right now I am using the following two shaders to render a sprite from a texture used as a sprite atlas onto a canvas that has canvas_size pixels in screen coordinates. I use a static quad as input ...
1
vote
0answers
11 views

Unity: Built-In Shader Transformation Explanation Resource

I'm working on some of my first shaders and taking a look at the variables included by cginc I see this list of transformation matrices: I've watched some beginner talks and I understand what the ...
0
votes
1answer
30 views

Opengles 2.0, Replace the black region in the image to make it transparent

I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do? This is my shader language: ...
3
votes
1answer
106 views

Sine-based Tiled Procedural Bump

I am trying to implement this formula to generate bump but I am facing some issue. The result doesn't look the same it's much darker. Here is my result (without same parameters) but it is much ...