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
12 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
43 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
14 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
14 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
62 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
18 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
27 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
76 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
0answers
16 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
16 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
20 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
27 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
29 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
44 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
79 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
34 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
16 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
65 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
47 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
99 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
86 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
51 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
14 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
87 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
44 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
342 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
50 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
38 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
46 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
24 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 ...
1
vote
1answer
41 views

Environment mapping - cube mapping using OpenGL

I'm trying to do cube mapping. Problem is that I'm getting this: This is what I get when I rotate it: But it should look like this Here is code for vertex shader varying vec2 tex_coord; void ...
3
votes
2answers
114 views

Render Occluded pixels to gray color

In 3d space, objects can be occluded by another objects. By depth testing, the occluded faces are skipped rendering. Only the nearest(smallest) depth value pixels are drawn. But, sometime we need to ...
1
vote
1answer
56 views

How to debug a GLSL shader? [duplicate]

I cannot find any tutorial in Google and Youtube. I have a C++ program that uses OpenGL ES 2.0 API to render something on the screen. How can I debug my shaders? Any step-by-step guide? What is the ...
10
votes
2answers
1k views

Rorschach ink blot (aka Psychology test pictures) shader

I want this magnificent pattern to be in my game. So far I have figured out... Draw one side, then render it twice left and right. How do I render this pattern on one side? hmm... I need help. ...
1
vote
1answer
60 views

How to create a material that blends textures in Blender to Unity workflow

I'm new to Blender and Unity and trying to figure out the best way to create a material that will use either vertex colors or a texture map to interpolate between other textures on a single mesh. ...
0
votes
0answers
40 views

speed/power trade-offs in sprite-based vs shader-based games?

I'm trying to understand how expensive (speed-wise and battery-wise) certain shader-based code is compared to the sprite-based code I'm used to. I apologize up front that this question is a bit ...
1
vote
0answers
118 views

Using GrabPass for 2D water reflection?

I'm trying to achieve some neat 2d water reflection effect with Unity, something like this: What I've managed to accomplish so far: The problem is GrabPass captures the entire screen but I really ...
4
votes
2answers
158 views

Discoordinated Chromatic Aberration Effect

The game Teleglitch heavily utilizes the CA effect with screen distortion. I am trying to achieve this effect. Issue 1. How to not apply the effect onto the floor? (solved) They render the screen ...
0
votes
2answers
79 views

Stencil based mask with alpha

I'm trying to create a fog effect like civ 5: I tried creating a StencilSet shader that receives a mask and sets the stencil buffer to 1. I would render the following on every unexplored tile using ...
0
votes
0answers
69 views

Taking a 2D slice of a 3D volume

I have a regular 3D polygon and I'd like to display 2D slices of it. What is the best way to achieve this? (Preferrably in OpenGL, but a general algorithm/tecnique would be good as well). I've ...
1
vote
0answers
39 views

Why would an ambient occlusion (AO) shader's performance be dependent on light direction?

One of my favourite games recently implemented ambient occlusion as a graphics feature, which appears to perform very well in most circumstances - except during sunrise and sunset. As someone who is ...
1
vote
1answer
58 views

Share a function between two passes inside CG Shader for unity3d

I'm writing a shader in CG language for Unity3d. When making transparent object you need to create two similar passes in SubShader. First to render only back faces (with Cull Front) and second to ...
3
votes
1answer
134 views

2D day night mapping

I'm looking for this kind of effect MINUS the lights and snow (Another problem). It needs to change depending on the time of year. Doesn't need snow or city lights. Now I'm pretty new to shaders ...
0
votes
1answer
61 views

Basic vertex shader, moving

I am new in shader concepts and I am trying to implement a sprite of 8x8 in OpenGL ES. I want to move the texture in the vertex shader but I cant figure out how to this, my code may be wrong, feel ...
0
votes
2answers
79 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
1
vote
3answers
27 views

How to sample a texture with specified LOD in SM 2.0?

That is my question, in SM 3.0 there is the HLSL intrasic function tex2Dlod to pick a color on a texture2d at specified coords and specified level-of-detail. But after long search on the web, I don't ...
0
votes
0answers
46 views

Alpha Lambert Shader Transparent even when Alpha is 1?

So I'm writing a shader that has to be differently transparent in different spots. However, when I use #pragma surface surf Lambert alpha, the object is partially transparent even when I force alpha ...
0
votes
0answers
28 views

Phong shading blows out things close to white [OpenGL]; is there a way around this?

I'm doing per-pixel lighting using the Phong shading model. In pseudo code this looks like: vec4 ambientColor = light.ambientIntensity * material.diffuse; vec4 diffuseColor = light.diffuseIntensity ...
0
votes
0answers
29 views

Slick2d - apply shader

I have a problem. I'm trying to apply a shader to the whole screen. Since I haven't used shaders before I don't know how to pass the texture to the shader. Everything else works... So here are the ...