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

Dot based light mask with shader on sprites

So I have a scene, completely based on 2D sprites. I want to render "light sources" into a seperate frame buffer (so mostly dots around, for example, the centre of a flame) and then render that frame ...
-2
votes
1answer
69 views

What's the difference between Rendering pipeline and compute shader?

What's the difference between rendering pipeline - https://msdn.microsoft.com/en-us/library/windows/desktop/ff476882.aspx and compute shader - ...
0
votes
0answers
31 views

Strange result, when changing variable name

I have no idea, what is going on. The mat4 xxx is the cause. Renaming it to "bones"/"bone_transfromations" etc. won't work it gives me an error. Renaming it to "test" works perfectly fine... This is ...
1
vote
2answers
124 views

HLSL Pixel Shader - Color depending on condition

I am new to shaders and HLSL so bare with me on this one. I have a 2D tile map in my game and want to create a mini-map, at first I was just copying all the data from one sprite batch to another and ...
0
votes
0answers
34 views

How to implement data structures for shaders

I'm currently researching computer graphics and esp. how to combine research and it's practical applications. To get started I wanted to implement the methods used by a few papers. First of which I ...
0
votes
0answers
46 views

Good system for experimenting with shaders in different languages

I'm trying to experiment a bit with shaders and they have been programmed in several different languages (GLSL, Cg and HLSL). Now most systems (dirrectX, openGL) have only support for one of them. ...
-3
votes
1answer
95 views

What's the difference between rendering and shaders?

What is rendering? What are shaders like vertex ,tessellation shaders etc? I am confused what's the difference between rendering and shaders? and how rendering is performed using shaders? Can we ...
0
votes
0answers
84 views

opengl shaders getting started problem

I'm following this tutorial for shading in opengl. However I wanted to start with another shader to make things more interesting So this gives me the following code: // Include standard headers ...
0
votes
0answers
13 views

C++ - Error X3501 Main Entrypoint Not Found [duplicate]

I was developing my DirectX 11 app, but when I wanted to add a function to draw a triangle, I get this error from compiler. Error X3501 Main Entrypoint Not Found This is how my main .cpp looks ...
1
vote
1answer
52 views

Pick which directional light shades which object

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first ...
0
votes
0answers
216 views

Most efficient way to achieve the following 2D heat wave background effect?

In Unity, what would be the most efficient way to achieve the following heat wave background effect Super Metroid - SNES (skip to 34m 5s for those on mobile) http://youtu.be/yB317FOcU0Y?t=34m5s ...
0
votes
0answers
115 views

DirectX Compute shader (HLSL) makes texture black

Hello this is my first question on this forum :) When using compute shader in directx to change the color to blue the texture only gets black. I really don't understand what the problem could be and I ...
3
votes
1answer
125 views

If-clause in GLSL

I read a few thing about, that in GLSL both sides of the if-clause is executed, so do you have any idea for a workaround for this one: uniform int uses_bones; uniform mat4[] bone_transformations; ...
1
vote
1answer
119 views

OpenGL/GLSL/LWJGL return value from shader

I'm trying to do some bone animation. I don't want the whole skeleton to be loaded to the GLSL shader every time, even tough it's not needed, because one vertex is parented to one bone, not more. My ...
1
vote
2answers
92 views

Curved Meters and Gauges

I'm wondering how people here on GameDev stack exchange would handle curved meter GUI elements for things such as life bars or energy bars. My thought on the matter was that you could use a shader ...
1
vote
1answer
166 views

OpenGL Positional 2D Texture Masking

I have a simple 2D java game engine running using LWJGL. I have my own vertex and fragment shaders, and I'm able to render quads with textures. I want to be able to mask one quad using the texture ...
0
votes
1answer
119 views

Is there a way to start with OpenGL 3.0+ without need to write my own shaders?

I'm starting with OpenGL and found out that after OpenGL 3.x you must write your own shaders (think it's obligatory). Am I right here? I have made some research but I can't seem to find the answer. ...
1
vote
2answers
136 views

How to prevent intepolated texture in fragment shader (Unity CG)

Think about minecraft - all the textures in minecraft have a very nice crisp pixelated look. Well, I'm trying to write a shader that will do this but it appears "sampler2d" returns some sort of ...
2
votes
1answer
126 views

Rendering lighting only on specific objects

I have done something similar to this in monogame: My question is, what would I have to do to draw that lighting effect only on the pillar and not the background ? Is there something like ...
1
vote
1answer
106 views

What is the fastest way of reading an atomic counter?

I have an atomic counter in my fragment shader that my application reads after each drawcall. I am currently using glMapBufferRange with GL_MAP_READ_BIT set. This absolutely destroys my applications ...
0
votes
1answer
90 views

XNA Distortion Shader problem

So I came up with a distortion pixel shader in hlsl, but it has some issues. First of all, here is how it works: The shader uses another texture generated by the program as a distortion "map" (if ...
0
votes
0answers
53 views

Fat geometry shader

I've seen this video: all the geometry seems to grow and become fat. Nice effect. I'm just approaching the shader matter, and I'm still have to learn a lot about how to change geometry via shaders. ...
1
vote
0answers
91 views

OpenGL: Avoid geometry shader for cubemap framebuffer

I want to render an environment map into a cubemap framebuffer but I dislike the fact, that I have to use the geometry shader to set gl_Layer because the geometry shader would be a basic passthrough ...
1
vote
0answers
43 views

SpriteBatch passing textures to GPU

How exactly (or, how often) are textures passed to the GPU shaders in MonoGame/XNA? I am asking because I was profiling a MonoGame/XNA application and noticed that the memory controller load (using ...
0
votes
0answers
20 views

Multisampled Nearest Filtering in PS 2.0 is it possible?

My game involves blocky, pixelated 3D textures. When using nearest neighbor filtering with a texture sampler, I get the desired result of nicely pixelated textures -- with the caveat that hard lines ...
2
votes
1answer
61 views

What will happen if the argument of mix() or clamp() is above 1 or below 0?

There's two magnificent intrisincs: mix() in GLSL and clamp() in HLSL, which are used to implement linear interpolation. Let's say we have a variable: float v = ?; // where ? can be [-FLOAT_MAX, ...
1
vote
1answer
383 views

Unity3D setting blend mode in shader using vertex data

I'm porting a game from iOS / Obj-C / OpenGL ES 2.0 to Unity. I have a procedural mesh script that generates a batch of quads that need to blend together to create a game board. Some of the quads ...
0
votes
1answer
64 views

Normalizing a homogeneous 3d point

As I've seen corruption in geometry, why is it a bad idea to normalize a homogeneous (divide by w) the vertex position returned from vertex shader? Update Vertex shader: // float4 pos : ...
3
votes
1answer
269 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
1answer
128 views

Java LWJGL - How can I add water to my 3d world? [closed]

The title says it all, how can I implement a simplistic water system into my game? I am using Java LWJGL and OpenGL glsl shaders. I am still fairly new to game programming, and a complete noob in the ...
-1
votes
1answer
216 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
213 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
650 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 ...
2
votes
1answer
116 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
423 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
2k 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 ? ...
13
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
58 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
84 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
235 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
149 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
244 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
110 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
167 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
67 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
46 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
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
1answer
58 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
1k 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
81 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 ...