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
8 views

UNITY3D - Orthographic Camera not render SHADER (2D GAME)

I have a problem with camera render, see the video please :) (note.: sorry for the music) http://youtu.be/BB8rXIzIWVU In Camera "Perspective", i can see the effect of shader: In Camera ...
0
votes
0answers
12 views

Unity - drawing halos behind everything else

I would like it so that the halos created by the draw halo parameter in spotlights are drawn behind all other meshes etc, currently it does this very weird thing where halos are sliced in half by ...
2
votes
1answer
29 views

Underwater Shader Animation Help

I found an underwater (distort) effect and I got it to work but somehow I cannot make it animate given the offset here: Fragment Shader code: uniform sampler2D fbo_texture; uniform float offset; ...
0
votes
0answers
21 views

crash while debug shader

I build a very basic directx 11 game that render simple cube with vertex and index buffer. I am run my game in graphic diagnostic and capture some frames. The problem is when I open the frame in ...
3
votes
1answer
63 views

Unity - Water Cube (to 2D game)

I wonder if you can create a cube of water within the unity! I'm starting to use the Unity, and took a sought as to whether there was already something like this ... but have not found any tutorial ...
3
votes
1answer
32 views

Strange depth map projection

I'm trying to implement depth-only SSAO and for that, I render a depth map into a texture and pass it to my SSAO shader which then uses it. The problem is that when I try to output the depth map ...
1
vote
1answer
73 views

Are shaders always faster?

Will using shaders or some other way of talking directly to the GPU always be faster than drawing to the screen in whatever language a game is being (mainly) written in? I guess that code with lots of ...
0
votes
1answer
32 views

Is there anyway I can make a plane visible from both sides?

In Unity i have a model of a tree with leaves made of a plane and a texture, when I upload it to unity the texture is only visible on one side so how can I change it to be visible from both sides ...
0
votes
0answers
15 views

What is dynamic branching in shader? And How to check which runs on android phone?

Is it simple "for" or "while" in loop with variable? Is it standard term? I have errors on some android devices with "for"-terms. [0020.31] Log: Compiling Shader 0x8200000000_0x3000000000000000, ...
1
vote
0answers
33 views

Set Render Target usage

I am using Unity and I have some difficulties about understanding the way Set Render Target works and how it can behave with the shaders. Is it possible to render a shader pass in multiple render ...
5
votes
1answer
68 views

How can shader code duplication be reduced in Unity?

In our current Unity project we have a few shaders that are basically just supersets of another shader. For example, we have a shader that performs lighting calculates with diffuse, normal, specular, ...
2
votes
0answers
53 views

Volumetric grass

I've been extremely interested in volumetric technology. Especially in volumetric grass. The online resources are extremely scarce on this topic. What is the difference from creating a lot of ...
1
vote
1answer
40 views

Unity5 - A Shader to blur far plane edges?

I need some help. In my Unity5 game I'm using two cameras, First camera renders the actual terrain and game objects (wich has a far plane of a 1000 units) and the Second camera renders a 3d skybox of ...
3
votes
0answers
66 views

Raymarching tangents

I've recently started to experiment with raymarching over on shadertoy.com. It seems common to find the normal for a distance field like so: vec3 scene_normal(vec3 p) { vec3 e = vec3(0.001, 0.0, ...
0
votes
1answer
69 views

Render Queue Sorting, HOW?

Recently I'm trying to implement a render queue sorting system, i.e., ordering my renderable objects in an array in such a way that the overhead of OpenGL state changes are minumum. After some ...
0
votes
1answer
24 views

Processing through multiple shaders (LWJGL/Java/OpenGL)

Very simple question: Is it possible to process a vbo through different shaders? If so, how? What I want is sth like this: reflectionShader.bind(); //starts shader reflectionShader.load(some_values); ...
1
vote
1answer
22 views

libGDX upload z-axis of sprite to graphics card

Background: I want to obtain each fragments position via vertex interpolation to then calculate the light vector for phong shading (L = [Fragment pos] - [light source pos]). Problem: At the moment I ...
0
votes
0answers
31 views

Unity - Meta pass and Precomputed Realtime GI

I am writing a shader in Unity and I would like to use some special values for the precomputed realtime GI. I am using a vertex fragment shader as it seems that it offers much more controls than a ...
3
votes
1answer
179 views

Monogame fails to load Effect

I'm currently porting an old XNA game over to MonoGame and everything (including custom shaders) build fine. However when i try to load the xnb file using content.Load<Effect>("BaseDraw"); I ...
0
votes
0answers
18 views

Pass uniforms to Filter's shader

I wanna implement this shader (https://www.shadertoy.com/view/MslGWN#) in PhaserJS state. So i transformed the shader to WebGL style. I overload Phaser.Filter's update function to pass iChannel ...
1
vote
0answers
12 views

Is there a way to control the ordering and grouping of ShaderLab Blend command?

I'm writing a shader in Unity that responds to 3 lights: 1 directional and 2 point lights. The point lights are processed in the ForwardAdd pass (once per light). I need the ForwardAdd pass to blend ...
0
votes
1answer
51 views

Pass-through pixel shader not displaying properly

I'm new to shaders, HLSL and XNA in general. I'm trying to write a pass-through pixel shader but I'm experiencing some odd behaviour. I created a simple texture, shown below: Here's what I see when ...
0
votes
0answers
17 views

OpenGL, glDrawElementsInstanced behaving differently on NVIDIA GPU than AMD

I have an AMD GPU on my desktop, AMD HD 5770. I am working on a project on my desktop for over a year. In the scene, I have instanced grass and instanced trees. Everything is working fine on desktop, ...
0
votes
1answer
18 views

Mapping “Color” parameter from SpriteBatch.DrawString() function to a custom shader

I've recently found a nice way to render text in XNA with custom font AND custom shader. Here is the game code**: using System; using System.Collections.Generic; using System.Linq; using ...
0
votes
2answers
65 views

How do I start and stop a GLSL shader?

Is there a way to start and stop a shader?. I want to use this shader to sweep once over my texture and then stop. Does anybody know how to do that? void mainImage( out vec4 fragColor, in vec2 ...
0
votes
0answers
25 views

Device.SetRenderTarget Prevents Shader From Executing

Using DirectX 9 and C++. I'm trying to finalize this code to run a HLSL shader on in-memory data. In theory it should be working. In practice the shader doesn't run. ...
0
votes
1answer
34 views

How to Set HLSL Shader Input Textures?

Very simple question. With C++/Direct9, I'm creating a texture as RenderTarget with a full screen quad, creating a scene, setting a HLSL pixel shader, copying the image and then call Present. 1) How ...
1
vote
0answers
101 views

Creating lightning effect with glow effect

I am trying to recreate Drilian's lightning bolt in unity and I have faced a problem in the "Adding Some Glow" part. I am missing glow effect (and/ or "rounded beams"). Here is what I am doing: I ...
0
votes
1answer
33 views

DX9 How to Apply HLSL Shader with StretchRect

Using DirectX 9,I'm trying to run a HLSL pixel shader on video frame data while copying it from one texture buffer to another texture buffer without displaying it. StretchRect at the end is what ...
0
votes
0answers
21 views

How to Set Compiled Pixel Shader

When compiling a shader with D3DXCompileShaderFromFile, it works. But what if the shaders are pre-compiled into .cso files? I have this function. It fails. What's the proper way of loading the pixel ...
0
votes
1answer
21 views

How to Create Device with D3DFMT_A32B32G32R32F

I'm trying to create a DirectX9 device to copy video frame data from one memory buffer to another while processing it through a HLSL shader. I will need half-float or float precision for each channel. ...
1
vote
1answer
32 views

Math behind XNA's spriteBatch.draw() color parameter?

I'm trying to make a shader that changes the color of a sprite the way the XNA spriteBatch.draw() color parameter changes color. I don't know exactly what it is called (the closest word I can think of ...
1
vote
0answers
31 views

Texture shader using model's texture

I'm trying to get a model rendered in monogame using a texture shader. I'm using the code from this tutorial project: http://kgiannakakis.github.io/MonoGameEffects/ I created a simple textured cube ...
0
votes
1answer
48 views

Transformation problems with hardware instancing in DirectX 11

I'm getting some wonky geometry in my application when trying to use instancing. I'm not sure if I'm doing the mapping of my per instance data wrong. This is how my mapping looks like: XMMATRIX scale ...
2
votes
1answer
84 views

Why is addressing an array of vectors more efficient than addressing an array of matrices in Cg?

According to Nvidia's Cg tutorial (in the note section right under 6.5.2), addressing an array of vectors seems to be more efficient than addressing an array of matrices. The reason it mentions is ...
0
votes
0answers
51 views

Run Simple HLSL Pixel Shader with DirectX 9

I'm trying to run HLSL Pixel Shaders with DirectX 9 where I feed a texture in, run the HLSL code and copy the resulting texture back from memory. I think I'm getting pretty close, although a LOT of ...
0
votes
0answers
20 views

Cube map for texturing edge distortions

I am using a cube map to texture a sphere and all is well except the seams that become very noticeable near the corners of the cube. I have tried to correct the sampling coordinates in the shader, ...
0
votes
1answer
67 views

Achieving Retro Resolution with HD

I couldn't really find any tips on this (or perhaps I just lack the proper words once again), but I'm thinking about how to get some retro looks (SNES 16 Bit, specifially) using a modern system. ...
0
votes
1answer
53 views

Will DirectCompute run this HLSL code

I found a sample about how to run a HLSL code with DirectCompute. https://code.msdn.microsoft.com/windowsdesktop/DirectCompute-Basic-Win32-7d5a7408 This is the HLSL script I want to run ...
1
vote
1answer
115 views

Run HLSL in C++ Basic Sample

I'm considering the idea of taking shaders written in HLSL and running them in an AviSynth plugin to process videos. This would allow accessing various shaders, and also to have GPU acceleration. I'm ...
0
votes
1answer
88 views

OpenGL texture seams

I'm atempting to make a game using OpenGL. So far I have loaded an .obj model, and I have generated a terrain as well as a very simple UI. My issue is that it 'seams' (tihi : P) that there are some ...
0
votes
1answer
60 views

Unity: cg fragment shader processing array of points

I need to write a fragment shader which would somehow be aware of N points that are in the scene and darken pixels based on their world coord distance to the points. I'm looking for a method that ...
0
votes
0answers
20 views

HSLS shader for floating point (grayscale) textures

I have the following problem: Input data is a float[], representing a 2D texture with floating point values (I need the dynamic range to be larger than 255), e.g. size 100x200. I would like to ...
4
votes
1answer
108 views

GLSL 2D Silhouette

I'm trying to render a silhouette of any entity behind foreground objects to indicate their position to the player. Here's an example of what I want to achieve, from Hyper Light Drifter: From what ...
1
vote
1answer
58 views

ETC1 Support on android alpha problem (GLSL cocos2d-x)

I want to support etc1 in my game, but somehow it doesn't work (I'm using cocos2d-x C++ GLProgram* glp = new GLProgram(); glp->initWithVertexShaderFilename("testv.vsh", "test.fsh"); ...
16
votes
2answers
422 views

How can I implement a short-cut grass effect?

I've been looking at some screenshots from games like Rocket League and FIFA: and I started wondering one would achieve the short-cut grass effect. Is it a shader? Is it actual geometry? Or ...
0
votes
0answers
73 views

Outline with toon shader in unity is way too large

This is what's happening to the model I've attached this toon shader to. It seems to be creating this black hole of some sort and I can't figure out why and how to fix it. I would just like it to ...
0
votes
1answer
40 views

OpenGL Shaders Ignored

I have been following this tutorial to try and start learning OpenGL. However, upon compiling my code, my triangle turns out to be black. At first I thought that there was something wrong with the ...
1
vote
0answers
49 views

Blinn-Phong lighting on Voxel models

I'm creating a game that is going to use voxel models. However I got stuck when I coded my shader using Blinn-Phong algoritm. Here is how it look (Only care about the red model): As you can see ...
0
votes
0answers
30 views

Add Atten property in Unity Shaderlab

In Unity Shaderlab shader, Is there any way to apply _Atten value? Using surface shader, and vertex/fragment shader I can do it easily. But, I didn't find any reference to do that in Shaderlab ...