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

How necessary are shader coders?

I know that gameplay mechanics programmers, either directly working with source or with scripting are needed, however there are so many shaders written already that I would imagine you could find ...
0
votes
0answers
21 views

Bilinear filter in repeating texture, HLSL

I have a repeating texture that I'm using as a scroll surface. The idea is that as I pan the surface I adjust the texture coordinates, filling in what gets wrapped on the right as it disappears from ...
6
votes
1answer
112 views

OpenGL 2.0 - Texture animation with 'pixelated' effect

I'm looking for a way to reproduce the effect I've tried to sketch in the image below with OpenGL ES 2.0. The idea is to let a drop of color fall over a cube which get filled with a kind of ...
2
votes
1answer
62 views

Possible to create transparency shader which doesn't stack alpha values

The image above best demonstrates what I'm trying to achieve. It's a transparent shader for objects, but wherever the objects with this shader intersect they don't add together but simply merge with ...
1
vote
0answers
36 views

SpotLight in ForwardBase pass using forward rendering

Is there anyway I can force Unity to allow me using a custom shader to render spotlights in a ForwardBase pass (using Forward Rendering Path)? For what I could see since now: Unity use and ...
1
vote
2answers
83 views

How to use blender files in your own engine?

It is not trivial to use your own shader on blender, so I've created a good-looking webgl shader. Now, what do I need to use the things I made in blender on it? An obvious first idea would be to parse ...
2
votes
2answers
128 views

Shader that “cuts” hole through all geometry

How can I create a shader that "cuts" through all geometry, only rendering the clearing background in Unity? An example: That's a prism in a huge white box-shaped room. The surface of the prism is ...
0
votes
0answers
27 views

vertices seem to render with the wrong shader program [closed]

currently, when rendering vertices there seems to be a bug in my application that results in these vertices not necessarily being sent through the pipeline of the active shader-program. Here is a ...
1
vote
1answer
44 views

In Unity, how can I read the color from _LightColor0 in a shader?

I have a scene with a point light and alpha textured (RGBA) triangle strips. I want to apply the point light color with a shader. Shader "Custom/Test02" { Properties { _MainTex("Texture ...
0
votes
1answer
89 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 ...
1
vote
1answer
64 views

OpenGL and atlas

I'm trying to draw element from a texture atlas with OpenGL ES 2. Currently, I'm drawing my elements using something like that in the shader: uniform mat4 uCamera; uniform mat4 uModel; attribute ...
2
votes
1answer
40 views

Disable depth testing for only some faces

I have some meshes and I need to be able to draw some part of them without depth test. Is it possible to turn off depth testing from within shader, wo that some parts will be rendered no matter what ...
0
votes
1answer
40 views

OpenGL UseProgram() fails

I have a rather strange exception on my application using OpenTK on Linux (ArchLinux with Mono 3.2.8) with GL.UseProgram(). I wrote a class to combine multiple files to one program: public sealed ...
2
votes
1answer
47 views

How To Set Constants Using ID3DShaderReflection

I got to the point where I am tired of hardcoding shaders and decided that it was now time to look into using ID3D11ShaderReflection to get data from the shader and set my shader's constant buffer ...
1
vote
1answer
57 views

How to create more vertexes from within a shader in OpenGL?

when rendering voxels in octrees, the only information necessary is the current octree-level, -position and colour/texture. But one has to send eight vertices to the rendering pipeline in order to ...
0
votes
1answer
41 views

Merging several textures into one using RGB channels

Would it be possible to place a texture into each RGB channel? Example: Red = wood.png Blue = tiles.png Green = metal.png The advantages I could see are saving space, memory and draw calls and the ...
2
votes
1answer
78 views

Is it ok to mix shader types?

The title might not be precise. Let's say I have one material consisting of vertex and pixel shader, another one consisting of vertex, geometry and pixel shader, and yet another one consisting of ...
1
vote
1answer
63 views

Blinn, Normal maps & Fresnel?

So something came up today when I was going over my Blinn shader. As I've been taught, the half-angle vector is calculated in the fragment shader, and is equal to normalize(lightDir + viewDir). This ...
-1
votes
0answers
36 views

Applying custom effect from nVidia Shader Library [on hold]

I'm quite new to XNA 4.0. I'm trying to apply an effect I downloaded from nVidia Shader Library, it's called post corona. I'm facing two problems, and I can't find any "compatible" examples or help ...
0
votes
0answers
53 views

Finding the correct transformation in vertex shader for easy sprite drawing

Before we begin the question: Here are the necessary meta information: I want to use JOGL / OpenGL to create a library that is only, and I repeat only, able to draw and manipulate 2D sprites on a 2D ...
1
vote
1answer
130 views

Alpha Blending: use the pixel with the smallest alpha

I'm writing a transparency shader where I need any intersecting textures to, wherever they overlap, take the texture pixel with the smallest alpha value and render only that, discarding the other ...
0
votes
1answer
49 views

Surface shader ignores lighting in vertexLit path

I want to use a surface shader in VertexLit(not Forward) rendering path. I caused a problem that the compiled shader completely ingnores lighting from the light sources on the scene. Here's the code: ...
0
votes
2answers
112 views

Rendering terrain only with GPU

This is not about generating plane geometry and then applying a shader on it. Instead, I want a big single flat plane, then apply a shader on it. The vertex shader has a uniform vec3 ...
2
votes
1answer
69 views

Using normals in DirectX 10

I've got a working OBJ loader that loads vertices, indices, texture coordinates, and normals. As of right now it doesn't process texture coordinates or normals but it stores them in arrays and creates ...
0
votes
1answer
44 views

How to change colors of texture in lwjgl? [duplicate]

I have the following texture: The black pixels are characters, the background is transparent. How do I change the black pixels of the characters to another color? I use this texture as a bitmap for ...
10
votes
2answers
278 views

Refractive glass shader

I have an infinite hexagonal floor, generated by tessellating a point grid in a tessellation shader pair: Note that this is a flat wireframe - the "shadows" are a lighting trick: Now, I'd like ...
1
vote
2answers
92 views

Does GLSL copy function arguments by value?

My question is about passing variables to GLSL shader. I'm not sure how that works and what are the performance implications. Say I got a function that accepts a "vec4" variable. The question is - is ...
1
vote
0answers
46 views

How can I combine my scrolling effect with the vertex lit shader?

I want my shader to work in both Forward and VertexLit rendering modes. I'd written a texture scrolling shader, but I also want to consider lighting which is produced by Vertex lit shader. I can't add ...
1
vote
0answers
58 views

Normal mapping does not work correctly using GLSL and OpenGL

Hello I wrote a simple OpenGl program using GLSL to render a simple uv mapped plane using the normal mapping technics. Here's the display with a simple phong shading (without normal mapping) : Now ...
8
votes
3answers
861 views

Is multitexturing really just “using more than one texture”?

This might seem stupid, but it bugs me. From what I understand, multitexturing is just using more than 1 texture per shader (usually to blend them somehow). So instead of creating 1 texture, I create ...
2
votes
0answers
67 views

Surface shader with VertexLit causes black object

I wrote the simplest possible surface shader: Shader "SimpleSurf" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Tags {"RenderType"="Opaque" } ...
2
votes
1answer
222 views

How to outline a 3D object with a cartoon style stroke? [duplicate]

How could I draw (stroke) the outline of a 3D object in a cartoon style with GLKit? I'm referring to something like this: However we can start with a simple line around the object and then try to ...
0
votes
1answer
62 views

How do I pass an object location into a vertex shader?

I am using Blender Game Engine. I want to create a large flat plane, and deform it locally near a moving object. So far (despite being a beginner at shaders) I've written a vertex shader for the ...
2
votes
2answers
81 views

How can I calculate spotlight lighting in Vertex/Fragment shader in Unity?

I've written a vertex/fragment shader for my game. It uses 3 textures and represents a floating water on the wall (so I have 1 texture for water, 1 for geometry and the last one is mask) so it looks ...
0
votes
1answer
59 views

XNA and HLSL shaders - Instancing using World Matrix array

I have posted this question on StackOverflow and was directed here, so I'll just copy the question: I am attempting to improvise some sort of hardware instancing in my game. I wish to draw multiple ...
3
votes
1answer
59 views

Why does my PixelShader ignore color but respond to alpha changes?

I started teaching myself some DirectX a short time ago and found something I'm confused about. For some reason, I can only get the color of the model I'm drawing to vary between black and white, ...
5
votes
3answers
218 views

How do I send multiple matrices to a vertex shader?

I'm practising animations using bones/skinning. I am trying to send the shader one matrix per vertex. I can think of these two approaches. Method 1 I have one uniform handle for each bone matrix ...
0
votes
0answers
43 views

Minimum/maximum depth of tile in OpenGL

I'm trying to implement tiled deferred rendering, but I'm stuck on calculating the min/max depth for each tile. I'm using compute shader for this. This is my shader code: #version 430 #define ...
2
votes
1answer
88 views

How to work with smaller intermediate textures in OpenGL and GLSL?

I'm working on a project rendering water simulated through smoothed-particle hydrodynamics (SPH) with a non-photorealistic look to use in games. In the actual stage of the project everything about ...
0
votes
1answer
77 views

Strange behaviour using VAO (OpenGL 4.0)

I want to display a simple textured Monkey mesh using VAO. Here's the code in the render part first without VAO to see what is the result I'm looking for. Texture *pTexture = ...
0
votes
1answer
74 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
107 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
0answers
59 views

How to fix problem in serpentine case using Blinn/Loop algorithm

I'm trying to implement Blinn/Loop algorithm to render cubic bezier on shader. I calculate the curve type using code below (v0, v1, v2, v3 are cubic bezier segment): CurveType ...
1
vote
1answer
42 views

SetFloat() in HLSL shader (effect) has no effect - variables stay at 0

I have a problem wherein I'm trying to set two simple float variables in my shader. I have a dozen other shaders in this project where it works fine, but for some reason, I've got a bug in this one ...
1
vote
0answers
184 views

How can I get this Shader for Unity working with Normal maps? [closed]

So I'm by no mean a shader coder, but I've been hacking around the last few days trying to get working a shader for the sprites of the skeletal animation tool Spine in Unity that can properly use ...
1
vote
1answer
59 views

Use of the xyY color space?

What's the use of the xyY colorspace in games? I'm not sure what's the advantage of using it in shader programming or elsewhere.
1
vote
1answer
114 views

Draw character silhouette when not visible

I have a mesh representing my character. I want to give it a partially transparent greyish silhouette when other objects are blocking it from view of the camera. I'm using Ogre3D, and GLSL as a ...
3
votes
1answer
185 views

Issue with interpolation on a burn shader (lerp and smoothstep)

I'm trying to create a simple burn shader. See here for more info on the method I'm using. However, I don't get why replacing the smoothstep with a lerp results in completely different results. Am I ...
1
vote
0answers
91 views

Shadow mapping implementation not working?

I am trying to implement Shadow Mapping in my program using Java/LWJGL/OpenGL/GLSL, but I cannot get it to work properly. Let's start off with a screenshot first, then the relevant code and lastly ...
0
votes
1answer
59 views

Textures not displaying. Problem with fragment and vertex shaders

Hi i have newbe question. I am sending to gpu textures unit and they dont display. This is simple version of my fragment and vertexshader. (More complicated version also dont work with other textures ...