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
0answers
52 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
232 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); SDL_GL_SetAttribute(...
4
votes
2answers
676 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. ...
2
votes
0answers
48 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
81 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
50 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
64 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 ...
4
votes
1answer
100 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
67 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
111 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
128 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
52 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
110 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 ...
4
votes
0answers
92 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
123 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
158 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
57 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
778 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. ...
16
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
65 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
58 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 formula:...
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
620 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
70 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
78 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
226 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
84 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
84 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
121 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
97 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
268 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
57 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 ...
2
votes
0answers
75 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
109 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 ...
0
votes
0answers
28 views

OpenGL - Program stops responding after linking a compiled shader

I have an OpenGL compute shader that compiles with no errors and I attach the shader to the program. When I try to link the program the program stops responding all together. I have never had a ...
3
votes
1answer
93 views

Do shader compilers typically know not to look up unused texture channels?

I have a texture that's from the color attachment of an FBO in OpenGL ES 2.0, so I have limited control over the number of channels in the image. Suppose I only need the color from the R channel of ...
0
votes
1answer
135 views

Draw cube in glsl shader

I am working on a voxel engine. Currently my cubes are rendered as vbos. I thought, it may be better to load only the cooridinates of voxels to the shader and make it draw a cube itself. Can someone ...
2
votes
2answers
231 views

Why has my refractive water shader become reflective

So I was making a water shader in unity and well it looked fine in the scene view but as soon as I went into the game view the refraction texture basically flipped up 180 degrees and made it look like ...
-1
votes
1answer
371 views

UNITY3D - Orthographic Camera not render SHADER (2D GAME) [closed]

I have a problem with camera render, see the video please :) (note.: sorry for the music) http://youtu.be/BB8rXIzIWVU In Camera "Perspective", i can see the effect of shader: In Camera "...
1
vote
1answer
77 views

Unity - drawing halos behind everything else

I would like it so that the halos created by the draw halo parameter in spotlights are drawn behind all other meshes etc, currently it does this very weird thing where halos are sliced in half by ...
3
votes
1answer
161 views

Underwater Shader Animation Help

I found an underwater (distort) effect and I got it to work but somehow I cannot make it animate given the offset here: Fragment Shader code: uniform sampler2D fbo_texture; uniform float offset; ...
4
votes
2answers
830 views

Unity - Water Cube (to 2D game)

I wonder if you can create a cube of water within the unity! I'm starting to use the Unity, and took a sought as to whether there was already something like this ... but have not found any tutorial ...
3
votes
1answer
94 views

Strange depth map projection

I'm trying to implement depth-only SSAO and for that, I render a depth map into a texture and pass it to my SSAO shader which then uses it. The problem is that when I try to output the depth map ...
1
vote
1answer
107 views

Are shaders always faster?

Will using shaders or some other way of talking directly to the GPU always be faster than drawing to the screen in whatever language a game is being (mainly) written in? I guess that code with lots of ...
0
votes
1answer
101 views

Is there anyway I can make a plane visible from both sides?

In Unity i have a model of a tree with leaves made of a plane and a texture, when I upload it to unity the texture is only visible on one side so how can I change it to be visible from both sides ...