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)

3
votes
1answer
190 views

Writing a glow shader

I'm trying to learn writing shaders. And I've pieced together something that is kinda working. I want to create a transparent glow around a sphere. The problem I have is that I can't seem to alter the ...
4
votes
1answer
116 views

How do I use openGL shader to reproduce this Photoshop implementation?

Here are my Photoshop actions: step1 - convert the current image into gray step2 - use the default parameters, as showed in the screenshot step3 - use the 『Hue/Saturation』 to convert the grey ...
1
vote
0answers
52 views

What game development tool can I use on a computer that does not support shaders? [closed]

I tried SFML, but found out that my computer does not support shaders. Given this restriction, what could I use instead?
14
votes
1answer
696 views

What are Hull, Domain and Geometry shaders used for?

I've done my fair share of 3D game programming for my (former) employer, and also in my own custom engines for my own indie games. Initially, I started with Direct3D 9, and D3DX9, which pretty much ...
0
votes
0answers
32 views

How do I set an array of matrices in HLSL?

I'm trying to render skinned meshes using Direct3D9 and HLSL. I am getting unexpected results due to the transforms that are bound to the shader. I am using PIX to view the constants and the values ...
6
votes
1answer
289 views

How is Signed Distance Field Ray Marching implemented for a dynamic world?

I think I understand the basics of Signed Distance Field Ray Marching. You model your scene with a bunch of distance fields (such as these: ...
0
votes
1answer
348 views

Terrain shader from heightmap opengl GLSL

I generated a terrain from a heightmap and now I'd like to apply shader on it which can contain different textures, based on height but I can't adapt any online code to my project. This is the ...
3
votes
0answers
145 views

Unity - reconstruct position from depth

I am using Unity and I want to reconstruct position from depth and frustum corners in pixel shader. I am doing this: In my App, I calculate view-space corners of the far frustum plane and pass them ...
4
votes
1answer
66 views

Shaders: packing 4 textures into a single RGBA - slower?

I'm experiencing something really strange on an iOS mobile device. I have 4 textures, and after some profiling it seems, that doing four separate grayscale texture reads is faster, than reading the ...
2
votes
1answer
107 views

Proper way to draw 1000 billboards that always face the camera

I have up to 1000 visible GameObjects with trivial plane meshes, which are essentially sprites/billboards and which should always face in the relative direction -camera.forward. There are so many ...
0
votes
1answer
91 views

How Apple Metal API distinguishes uniforms from vertices buffers?

I am not sure how metal distinguishes uniforms from vertices buffers? As far as I know code for passing uniforms in buffers are the same like for vertices: [self.commandEncoder ...
1
vote
0answers
45 views

How to create offsetting lines that draw across the screen in Monogame?

I'm trying to create an effect on the screen like the gif below. Basically lines that are offset by 1 pixel draw across the screen from either side which then eventually creates a solid color. I'm ...
1
vote
1answer
159 views

Version 320 is not supported, SDL C++

I have the following four lines before I create the window. SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); ...
4
votes
2answers
498 views

How to place grass on custom terrain mesh

I made a custom terrain mesh and textured it, now I want to place grass on it, but I don't know how. I only find info about grass with the unity terrain. I am not even sure what exactly to look for. ...
1
vote
0answers
44 views

Consistent Shadow Map Filtering

I want to filter my shadow map generated by PSSM, but the problem is that I have a inconsistent filter size. The problem is that the shadow map sources rotate to find the best fit for the camera ...
1
vote
0answers
61 views

glTextImage2D with GL_UNSIGNED_BYTE giving weird results while with GL_FLOAT just works, driver bug?

Update: OK, not being able to see the textures loaded by FreeImage was just one of the common mistakes when using modern OpenGL. My texture loading code did not set GL_TEXTURE_WRAP_S/T and ...
2
votes
1answer
47 views

Shaders wont bind to the uniform block

I'm having an issue with interface block binding. Example shader: const char* vertexShader = "#version 330 core\n" "uniform globalMatrices" "{" " mat4 ...
2
votes
1answer
59 views

Change value of uniform for each VAO

I've heard from several sources that it's a better approach to pass the model matrix to a shader via a uniform rather than an attribute. I also know that the idea of a uniform is, that it has the ...
3
votes
0answers
81 views

Unity 5 - custom lighting model

I have tried to use my own lighting model in surface shader in Unity. But there is a problem. If I init my own lighting via #pragma surface surf _SimpleSpecular Lighting_SimpleSpecular method is ...
4
votes
2answers
66 views

Displaying smooth borders given a coarse grid-based map

I've been messing around with different algorithms trying to make a grid based map look smooth, I have tested with various shader based methods and wrote a few of my own but none of them look right. ...
3
votes
1answer
105 views

How to write a custom shader in Unity 3D that lights up a specific pixel or group of pixel?

I'm making a FPS game in Unity, and I want the environment to light up as the player is shooting on his environment. The map would be entirely put in darkness at the beginning, but as the player ...
6
votes
2answers
124 views

Shading Languages vs Materials in 3D editors

There are many 3d packages which are able to construct materials. Autodesk Maya, 3ds max, Houdini, etc. There are languages which are able to construct materials as well, like GLSL and Cg. How does ...
2
votes
1answer
46 views

Shader constant management problem in DirectX 11

I've been learning the "dragon book" written by Frank D. Luna and trying to implement the part of the demo on my own. As some of you can see, the demo of the book uses effects interfaces to update the ...
1
vote
1answer
80 views

Shader and Texture Scrolling depending on Direction

I am trying to scroll a texture using its uv in Unity but I don't get the result I need. The aim is to have two components, the speed and the direction. I would like to define the direction in ...
3
votes
0answers
82 views

How to draw Shadow Volumes in one draw call?

I've got a simple app that draws 3D cubes using instance rendering and I'm implementing Shadow Volume. Each cube's vertex, uv, normal and index data are statically stored in 4 vertex array buffers. On ...
2
votes
0answers
100 views

Ways to get around the limiting default terrain shaders in Unity

I am trying to use the Toon Rim Light shader for Unity however there are a few problems when trying to use any custom shaders for a terrain in Unity. The most well known is of course, that all ...
6
votes
1answer
200 views

In a shader, why does substituting a variable with the expression producing it cause different behaviour?

I have this correctly-working OpenGL shader producing Perlin noise: float left = lerp(fade(v), downleft, topleft); float right = lerp(fade(v), downright, topright); float result = lerp(fade(u), ...
1
vote
1answer
127 views

Unity — custom shader behaves differently on WebGL deployment (correct) and editor view (incorrect)

I started working on shaders and lighting on Unity3D 5.2.1f1. I set up a scene where the sun object rotates the directional light (the only light in the scene) based on its position to simulate a ...
2
votes
0answers
56 views

Phaser: Shader Chain

I want to implement lighting via shadowmaps. I see process as: 1) render something to RenderTexture1(size as game) 2) create RenderTexture2 (custom size) 3) add it to Image2 (custom size) 4) apply ...
3
votes
1answer
460 views

masking with 3d object in unity

I have a 3d plane in my scene and some 3d objects behind that plane. So, i want to render only the part behind the 3d plane. So how should I do this, should I have to use custom shaders, plz help.
1
vote
0answers
26 views

DirectX 9 Light projection

I am trying to see changes of component 'z' from light space. In vertex shader component 'z' divide 'w' is not 0. But after sending float4 with texcoord1 to pixel shader its 0. All matrices are good. ...
15
votes
1answer
2k views

Phong lighting - there is something very strange with specular lighting

I implemented Phong lighting. Everything seems to work - torus and spheres are lighted as expected, etc. But I notices something strange regarding specular lighting of directional light. Here are two ...
0
votes
1answer
60 views

Fixing strange artifacts in an HQX shader

I'm having an issue implementing an HQX filter that I found in the LibRetro GitHub repository. LUT texture was obtained here Shader file was obtained here (I converted it to compile in MonoGame with ...
0
votes
1answer
41 views

What do shaders encompass?

I'm researching shaders as I'm thinking about doing them for my final year project at Uni. I've looked at a lot of examples online and I think I get it. It's something that you apply to an object or ...
1
vote
1answer
52 views

Specular intensity of non-metals(plastics) in metalness pbs workflow

The specular color in metalness/roughness workflow is usually defined as following: float3 specColor = lerp(0.03f, albedoColor, metallic); The Cook-Torrance BRDF is given with the following ...
0
votes
1answer
46 views

OpenGL: Objects wont draw at certain angles while using lighting(shaders)

I was following this tutorial (http://www.lighthouse3d.com/tutorials/glsl-12-tutorial/point-light-per-pixel/) but when the camera is at a certain angle, if I had alpha test and blend enabled the cube ...
1
vote
1answer
456 views

Monogame shader not working

I'm trying to use this this tutorial in monogame, but the effect does not work, only renders a black screen. Everyhing by itself renders just fine, I looked at the render targets if they get drawn to, ...
1
vote
2answers
67 views

SDL_LoadBMP into glTexImage2D results in scewed colors

I read up on this but i can not find the error. Some suggest switching the format from RBA to RGBA but the surface data says it is 3 byte data. Here are snippets and results of my source. Loading ...
0
votes
2answers
73 views

No output to screen using Multiple Render Targets and multisampling

I'm having a little trouble with XNA, but I doubt it's specific to the framework. I draw a few 3d models to 1 rendertarget with multisampling turned on, and it works fine. If I draw the same scene to ...
1
vote
0answers
188 views

Water drops on camera

How can I create water drops on camera something like we see in Ripitude GP, I tried using Unity's default GlassStainedBumpDistort shader though its performance heavy on mobile plus it do not let ...
0
votes
2answers
72 views

Shader value remap - Blend Falloff

I would like to know if there's a way to remap a value that goes from 0 to 1 constantly like this. Into those values (those are examples). This might be some function transformation but I can't ...
0
votes
1answer
71 views

How to determine vertex index using Shader Model 3 or lower?

I need something like SV_VertexId (added in Shader Model 4) in HLSL shader to determine which vertex is currently handled. Unfortunatelly, I can compile only vs_3_0 or lower. The objective is to ...
1
vote
1answer
110 views

White dots artifacts when applying borders to hex tiled geometry

I have a hexagon tiled geometry I created in Blender Which I then load in WebGL, using THREE.js library. Below is the loading code, I've cut the code of creating scene, lights, etc. I create ...
0
votes
0answers
95 views

What is a good way of handling shaders?

I'm currently reading this book and are at the chapter about the rendering subsystem of a game engine. Now, the book suggests that a material is a structure that provides information on how to shade ...
0
votes
1answer
31 views

OpenGL Mapped Memory Shader Source

Is there any way to get a pointer to a newly created shader object's source? I'd like to load a shader directly from file in to my shader object instead of loading to an intermediary variable and then ...
3
votes
2answers
243 views

How to achieve a dynamic soft see-through hole effect in a wall with shaders?

I'm looking for a way to create a dynamic soft see-through hole effect for room walls. I know a few ways how to do it (for example multitexturing with second layer being the hole mask in screenspace), ...
0
votes
1answer
50 views

D3D12 ConstantBuffer - Shader receives wrong values

im having trouble with one constantbuffer: struct CameraConstData { urd::Matrix projection; // 64 ( 16 floats) urd::Matrix view; // 64 ( 16 floats) urd::Vec3 viewPosition; // 12 ( 3 ...
1
vote
0answers
66 views

Using depth values for fake ambient occlusion

I'm using the normalized distance to the camera to get depth information in the fragment shader. When using this value as fragment color, it looks at lot like ambient occlusion (of course only in the ...
0
votes
1answer
41 views

Modify Element of Struct Array

I have this struct array in GLSL. struct Test { vec2 value1; vec3 value2; float value3; } uniform Test u_test[5]; How can I modify the elements of this array one at a time? I know that ...
1
vote
0answers
98 views

Rotating, moving and scaling a mask in a shader

I want to rotate, move or scale a mask in a shader. But I have no clue to how perform these actions. My code: @Override public void create() { batch = new SpriteBatch(); background = new ...