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

glsl shader to allow color change of skydome ogre3d

I'm still very new to all this but learning a lot. I'm putting together an application using Ogre3d as the rendering engine. So far I've got it running, with a simple scene, a day/night cycle system ...
3
votes
1answer
266 views

Shader that draws just vertex points

The game I am developing is in unity and I want to make a shader which can be put on a mesh that only 'draws' color on each vertex point. I am not proficient with shaders, and out of all my searching ...
0
votes
0answers
25 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
1answer
189 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ...
0
votes
0answers
13 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, ...
1
vote
1answer
211 views

Mesh fading to transparent

I have a 2D Mesh object generated at runtime painted all with uniform color. I want that mesh to have its color fade to transparent color close to the edges. Despite I searched everywhere I could not ...
16
votes
2answers
316 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
2answers
78 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 ...
0
votes
1answer
271 views

VertexColor shader is not working correctly in built application

I want to change the vertex colors of my mesh. The light sources must not affect the objects with this shader, its lighting must be determined only by its vertices colors, so I turned the Lighting ...
0
votes
1answer
13 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 ...
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
1answer
75 views

Outline of plane slice of arbitrary object

How would you extract the outline of a shape from slicing a plane through an arbitrary object? Note: This is related to my Unity Answers question, but not exactly the same.
0
votes
2answers
61 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 ...
1
vote
1answer
106 views

3D GUI Shader Problem

So I want to create one of these in my directX11 project. The little axis there that shows you the direction. I have a nice 3d shader for my world geometry that I tweaked from Frank D. Luna (He ...
0
votes
0answers
17 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
26 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
70 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 ...
1
vote
1answer
98 views

Apply an special effect to an scene area

I have a 2D game where I have a second camera on my scene, that renders an upside down image of the scene, and distorts it, giving the effect of water reflection. I render this camera first, and on ...
0
votes
3answers
1k views

Can't render to FBO using a shader

I've added functionality so that I can render to a framebuffer (for post-processing and stuff). I can successfully render to my framebuffer and then render that framebuffer, but anything with a ...
1
vote
1answer
155 views

Problems with texture orientation in space

I am currently drawing texture in 3D space and have some problems with it's orientation. I'd like me textures always to be oriented with front face to user. My desirable result looks like ...
0
votes
1answer
141 views

Having trouble getting shader to work with sprite batch in XNA #4

I found a neat "CRT screen" effect shader on the web, but I've never used shaders before and I can't seem to get it working properly. If I do the second sprite batch in my code here normally without ...
0
votes
0answers
14 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
15 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
366 views

When should I set a texture as a shader resource in order to read it?

I'm writing a Direct3D 11 HLSL shader with SharpDX. What I want to do is write the depth to a texture in one pass and read it in the next one. After declaring the texture, do I have to set the depth ...
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. ...
0
votes
1answer
256 views

OpenGL Shader Storage Buffer Objects array length problem

Ok guys, I think I have a very strange problem. I have an old laptop, but its HD 6370M currently supports opengl 4.4, so i decided to learn how to use some new features of this platform, so after ...
4
votes
1answer
85 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
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
28 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 ...
2
votes
1answer
78 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
1answer
43 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 ...
0
votes
0answers
32 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
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 ...
3
votes
1answer
90 views

How do you add turbulence to a particle system using noise?

I have implemented a basic particle system using transform feedback in openGL, hoping to replicate a dust cloud. I have looked at methods of adding turbulence, such as vortices found here. But they ...
0
votes
0answers
15 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
2answers
501 views

Using Appendbuffers in unity for terrain generation

Like many others I figured I would try and make the most of the monster processing power of the GPU but I'm having trouble getting the basics in place. CPU code: using UnityEngine; using ...
0
votes
2answers
364 views

translate-scroll repeated 2d texture using opengl shader

I managed to implement an infinite 2d texture scrolling using the following shader. btw I'm using cocos2d-x 2.2.1. The vertex shader: attribute vec4 a_position; attribute vec2 a_texCoord; #ifdef ...
0
votes
1answer
85 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
48 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 ...
1
vote
1answer
97 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
2answers
73 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 ...
1
vote
2answers
176 views

2D Hidden Object Silhouette Shader

Right now I am not using any depth information in my engine, but I just found out that it would be neat to be able to render the silhouette of important game objects that are "behind" something with a ...
0
votes
1answer
50 views

Second pass in multipass effect is ignoring

I am trying to render my vertecies in 2 passes, but seems I am doing something wrong, because only one pass applying. I cannot make the second one work despite that second pass is applying. Here is ...
0
votes
1answer
87 views

Encoding Float to RG/RGBA and Blending

Encoding a float value inside a RG or RGBA texture is very interesting and useful but it is also become quite useless when you use blending as the result and the values might be altered because of ...
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 ...
1
vote
1answer
43 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"); ...
0
votes
0answers
49 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 ...
-1
votes
0answers
43 views

Shader request (cg shader provided) : an xBR scaling shader for Unity [closed]

I'd like to scale up my game view from a native resolution of 512x300 to 1024x600 using the xBR cg shader found here : https://github.com/libretro/common-shaders/tree/master/xbr Here is a question ...
0
votes
0answers
22 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 ...