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
1answer
17 views

FXC: Error X3501: 'main': entrypoint not found

I am trying to compile a vertex shader using VS2013, but every time I try, FXC returns the following error: Error error X3501: 'main': entrypoint not found I've reduced the vertex shader to its ...
1
vote
1answer
32 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 ...
1
vote
1answer
72 views

Discard Transparent Pixels in Z-Buffer

I am building a 2D game using sprites. I'd like to use the z-buffer to aid with shading. For that I need Unity to write only opaque pixels to the z-buffer (aka depth buffer). In Unity, sprites are ...
1
vote
1answer
40 views

VS2013: Compiling Shaders with Shader Model 5.0

When I try to compile two HLSL files included in my project, the compilation fails with an error: Error error X4502: invalid vs_2_0 input semantic 'INSTANCE' However, I notice it's trying to use ...
0
votes
0answers
71 views

2D Distortion shaders for water effect

I'm working on Unity, and I'm trying to improve my water. The water will be seen top down, and I want to apply a shader to it to make it better looking. I understand the concept of distortion shaders ...
1
vote
1answer
49 views

Explaining Unity Sprite-Default Shader

I would like to know why we would use alpha blending in that shader for just rendering a sprite, which is just a texture ? What is tint color ? Why we multiply the alpha value by the color here ? ...
11
votes
3answers
3k views

How do I control which calculations are done on the CPU and which are done on the GPU?

My current understanding is that anything done in a shader file is done on the GPU, and anything done in my (Java, in my case) code is done on the CPU. Is this an accurate description?
0
votes
0answers
53 views

SFML - Rendering a torch with a fire animation [duplicate]

I have coded a 3D maze simulator in SFML using raycasting. However, I want to add a torch to the screen, so that the lighting seems more realistic. From my understanding, I would have to use ...
0
votes
1answer
40 views

What are .fxo and .cod files for?

I've been reading about shaders and looking at code. I found this in the code I'm looking at and it obviously has "Basic.fxo" there. BasicFX = new BasicEffect(device, L"FX/Basic.fxo"); Now my ...
0
votes
3answers
83 views

How to render grid properly, especially over distance?

I'm drawing a grid, pretty much like one can see in the Unity editor itself or any 3D-editor, many 3D-related applications and some games. But it doesn't look pretty in my case. I put a few random ...
1
vote
1answer
61 views

How can I make this shader background more efficient?

I want to use a shader as a background for a mobile game. I'm using libgdx for my project. I've never written glsl before, but here's my attempt so far: http://glslsandbox.com/e#22332.13 On desktop ...
2
votes
3answers
187 views

Generating 3D-like effect

I'm making a 2D sidescroller game and want to give the blocks a 3D like effect. This way it looks like the player is walking on 3D blocks while walking on a 2D plane (thus having only x,y ...
1
vote
1answer
61 views

Shader - Realtime texture masking

The first thing that comes in mind is masking using RGBA values. With this you can obtain this kind of textures and this kind of results. But with this, you can only store up to 4 masks inside a ...
0
votes
1answer
36 views

Discarding triangles in Unity

I have about 2+ years of experience in computer gaming development and I just started writing my own shaders to help me utilize performance. I have this problem that I'm trying to work around but ...
0
votes
1answer
48 views

Reasonable texture Formats for VertexTextureFetch in GL

Wich is a reasonable GL version that have support for vertex textures fetchs(VTF) in OpenGL ? (for example GL 3.0, 3.1, 3.3) What textures formats should I expect to be supported in average video ...
0
votes
0answers
22 views

Encoding Floats to RGBA and Blending causing artifacts

I am using float packing to encode a float value inside a RGBA texture because I don't have access to float texture unfortunately. Here are the function I am using for encoding and decoding. inline ...
0
votes
1answer
28 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
1answer
43 views

How is this particular HLSL condition treated with respect to compile- or run-time evaluation?

Let's say I have this very simple pixel shader (cbuffers and other stuff omitted) float4 PS(VertexOut pin, uniform bool useLighting) : SV_Target { float4 retColor = gDiffuseMap.Sample( sampler0, ...
7
votes
1answer
447 views

How to implement this kind of ripples with a GLSL fragment shader?

So I have already implemented the reflection part: uniform sampler2D texture; uniform vec2 resolution; uniform vec3 overlayColor; void main() { vec2 uv = gl_FragCoord.xy / resolution.xy; if (uv.y ...
0
votes
1answer
48 views

Cubemap faces rotation in GS shader

I Can't get correct rotations for cubemap faces. Thats should come to geometry shader, from camera "view" matrix I want make 6 faces for my cubemap, but seems I can't get it correctly... My first ...
1
vote
1answer
59 views

What's wrong with my method of getting intermediate rendering to my postprocessing shader?

I'm working on a project in OpenGL. Earlier this week, I successfully implemented Deferred Shading, but I'm not sure how to pass the information from the Deferred Shader to the Post Processing Shader. ...
0
votes
1answer
71 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(); ...
8
votes
1answer
309 views

Creating a glitch effect similar to Watch Dogs

I'm currently working on a LibGDX game. When a user does something wrong, I would like all the graphics on the screen to jitter very similar to the glitch/distort effect seen in the game Watch Dogs ...
0
votes
1answer
79 views

Fragment Shader output type error

StackExchange! I've been working with opengl for a bit and I'm trying to finally load the shaders instead of having them inline. I'm having a ton of issues, though. As soon as I solve one, another ...
2
votes
1answer
48 views

The way of avoiding branching for textured and not-textured objects

I know that branching is an expensive operation on GPU (not as much as it used to be, but still). The most common situation where I use branching is when I have both textured and non-textured ...
2
votes
1answer
99 views

How can I create a screen-space distortion effect?

I am trying to create a screen-space distortion effect using shaders. This image demonstrating the effect I'm after is from Nvidia: Let's consider that I have access to the background texture. How ...
3
votes
2answers
68 views

How can I draw curves above a mesh surface?

I am making an animation of a deformed sphere that represents some aspects of the wave function in a hydrogen atom. I am starting with an octahedron that i push through a tessellation shader. The ...
0
votes
1answer
57 views

Drawing a Line in 3D using DirectX 11

I had a lot of problems to draw a line in a 3D and had a weird results.. The 3D Lines are projects in 2D and that's so weird. They only work with that view matrix configuration: XMVECTOR Eye = ...
0
votes
0answers
40 views

GPU skinning weird issue [duplicate]

I finally got my GPU skinning to work! (Mostly) I'm using MD5 format and this here tutorial However the weird part is that I'm getting EXACTLY the same issue as this unanswered post: here The ...
8
votes
1answer
280 views

Implementing a Graph-Based Material System?

I'm trying to wrap my head around how material systems like this, this are implemented. These powerful and user-friendly, graph-like systems seem to be relatively common as a method of allowing ...
1
vote
3answers
144 views

2D HLSL World position

I'm trying to get world position from my vertex shader to my pixel shader so that I can disable the shader once a preset X coordinate has been passed (no shading once I'm over X). Getting the screen ...
0
votes
0answers
120 views

Slick2D shader crashes, but only after a while

I'm using Slick2D's ShaderProgram for shader-based drawing in my game. Some players report that after 3-10 minutes, the game inevitably crashes hard during what appears to be a setUniform4f operation ...
8
votes
1answer
414 views

How do I render my 3D game in ASCII art?

I'm trying to create an easter egg for a 3D game in Unity3D. I've the idea to pass my game momentarily in ASCII art. My first idea is to create a shaders to do that, but i'm not sure if it's the ...
0
votes
0answers
54 views

Grayscale and 2D lighting using cocos-2dx

I want to create a lighting effect on a gray-scaled world using cocos2d-x. What I've done is creating a layer which runs a shader program that receives light positions and radiuses as input and ...
1
vote
0answers
63 views

Understanding diffuse lighting in The Division

Here is a screenshot of the main character walking under a bright lamp: His hat, that was originaly dark grey, turns completely white. My question is how can such lightsource do this without making ...
1
vote
1answer
55 views

Bloom control - enlarging glare area

I am trying to improve my bloom system. So far I have bloom that looks like this: What I need is to enlarge the low-bloom areas to make it look like this: Simply increasing the bloom multiplier ...
2
votes
1answer
74 views

Opengl Quad Tessellation Control Shader

I have the generic tessellation evaluation shader for triangles but I need to make it work for quads. Is there any chance someone could explain what is happening here and point me in the right ...
0
votes
2answers
17 views

Setup VertexPositionTexture array for a texture2D at a location

I am trying to adjust the following code to render a quad on a 2D texture at a specific location and specific size. Currently this code will render a fullscreen quad, which makes sense since the ...
3
votes
1answer
330 views

I want to render some surfaces in GLSL with normal maps, and some without

I have normal mapping working in my game, but I want to only use normal mapping for some surfaces, and not others. Right now, as far as I can tell, my shader is applying an incorrect normal of (0, 0, ...
1
vote
2answers
50 views

Dynamic Flow Control in HLSL with Array References

I'm trying to do lighting calculations for an array of point lights in HLSL. I simply want to pass light direction vectors from the vertex shader to the pixel shader. Here is sample code: static ...
1
vote
2answers
164 views

How can I implement a futuristic “barrier field” that reacts to hits?

I want to implement a "shield" that reacts to projectile hits. Currently, my colliders are mapped to the animated sprite's outline on all frames. I'm looking for something like the image below. For ...
0
votes
0answers
28 views

Placement Shader [duplicate]

Do you know what this shader is called, if you can give a link that's even better :) . I am talking about the green outlines on the objects that are selected. That's the shader that I would like to ...
0
votes
0answers
40 views

Very subtle HLSL syntax change causes compliation error

The following HLSL works and compiles: texture2D renderTarget; float h; // declared here sampler GetRenderTarget = sampler_state { texture = <renderTarget>; }; float3 GetHsvFromRgb(float3 ...
8
votes
2answers
349 views

How do I perform an xBR or hqx filter in XNA?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) or an xBR filter in a shader. How can I do this in XNA 4.0 and SM3? Side note: this question has been heavily ...
2
votes
0answers
144 views

How to read neighbor pixels in GLSL?

I'm using SFML 2.1, it's much more straightforward for me so I can jump directly to learning the shading language. I'm trying to do something similar to conway's game of life. I already learned that ...
0
votes
2answers
135 views

Combine flat and smooth shading with a single model geometry

I need to be able to switch between smooth and flat shading interactively. Is there a way to do this efficiently with a single geometry? For example, smooth shading does not require duplicate ...
1
vote
0answers
39 views

Sprite framework binding multiple textures

In an attempt to batch render as many quads (sprites) as possible, I'm instance rendering a single unit-sized quad and passing in a buffer of per-instance data that includes width/height, texture ...
0
votes
2answers
66 views

How can I run a shader over the entire screen without interfering with other running programs?

I'd like to avoid hooking into DirectX, and just run a shader over the entire screen. Is this something I can do in Windows without draining an unreasonable amount of resources? I can use whatever ...
1
vote
1answer
126 views

Basic terrain shader without using external texture

I have this: (Right now I have the height map in a x*x size 2D array and a 1D vector too.) What I am trying to achieve is something like this: Without using any textures, only plain colors. So ...
1
vote
1answer
59 views

How to fix model matrices colliding in vertex shader?

I am new to OpenGL programming and I'm writing some basic code to display a few objects onto a screen. I have a pyramid shape that I'm displaying, as well as a box shape that I am displaying. The ...