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

How do I mask a height based fog?

I've been trying to implement a 3D (with the Y axis being utilized) fog of war system similar to what XCOM uses. There is only one hint that really seems to nail it, but I can't read the actual ...
2
votes
1answer
107 views

Why are faces being drawn like this with my custom shader?

I've been writing a custom surface shader which allows for vertex colors (with alphas) to be set programmatically. From test runs of the shader itself, it works perfectly fine, and I am able to set ...
2
votes
1answer
1k 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
55 views

Does Specular Power affect the Brightness?

I read the book Real-Time Rendering, 2nd Edition. Somewhere in there it say: But I did the experiment and concluded that the mshi doesn't seem to affect to the brightness (it causes the area just ...
2
votes
1answer
497 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 ...
2
votes
1answer
602 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
2
votes
1answer
323 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(); ~...
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 ...
1
vote
2answers
242 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
4
votes
1answer
103 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 ...
1
vote
1answer
51 views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen but an unable to using the Projection, View and Transformation Matrix's but an unable to get anything to the screen. Main loop ... ...
1
vote
1answer
34 views

Axis Aligned Bilboards in shader

Hi I need to implement following effect using vertex shaders. Basically its a shader for particle laser beam that rotates to particle along its own y axis till its "best" visible (Roughly). My idea ...
6
votes
2answers
118 views

Is there a way to make the boundary between materials wavy?

I have a sea trading game that I'm working on developing. Right now, my world looks like this: There are 4 different "biomes", with more to be added. Internally, this is a large mesh which has 4 ...
0
votes
0answers
15 views

Lens Distortion not working with Unity 5.3.5

I have downloded the latest sdk from this link https://github.com/googlevr/gvr-unity-sdk I imported the package into my project.From the prefab added GvrMain to my scene and set the Distortion ...
3
votes
1answer
212 views

Apply a special effect to an scene area

My 2D game has a second camera on the scene that renders an upside down image of the scene and distorts it, giving the effect of water reflection. I render this camera first, and on top of it I render ...
1
vote
0answers
23 views

Models keep turning white - Unity 5.3.5p1

I'm using Unit 5.3.5p1 but for some reason my models randomly turn white after I build an exe to run outside the editor. The textures work perfectly fine within the editor, but as soon as I build and ...
0
votes
1answer
17 views

XNA HLSL Shader Color Swapping based on lightness

I'm trying to achieve a similar effect to the image below in HLSL. [Ignore the inbetween state, currently I'm only trying to achieve the final phase, which is black and red] What I tried so far is ...
15
votes
0answers
508 views

How can I get PagedGeometry grass to receive shadows?

I made the switch to Ogre3D (v1.7) and to using PagedGeometry. What I'm trying to do is make a simple scene with a terrain, some trees and grass. In a nutshell, I would like to achieve this kind of ...
1
vote
0answers
15 views

Keeping a mesh entirely at the GPU and changing its vertices there with a ComputeShader (Unity5)

In a Unity game I have an object whose mesh is made of around 10k vertices and I have to make changes to these vertices (position, color, etc) almost every frame. Considering that such object is ...
0
votes
0answers
23 views

Frustum Culling behaves incorrectly with vertex shaded objects

I have a scene with a straight path. It looks something like this: I've also wrote a vertex shader that bends the path. After applying the shader, it looks something like this: If you were to ...
0
votes
1answer
146 views

DX9 How to Apply HLSL Shader with StretchRect

Using DirectX 9,I'm trying to run a HLSL pixel shader on video frame data while copying it from one texture buffer to another texture buffer without displaying it. StretchRect at the end is what ...
-1
votes
2answers
105 views

What is the most efficient way to render water?

Would I create the water surface mesh in C++, and control the movement/animation in the CPU, and afterward apply any shaders (reflect/refraction/caustics/etc..). Or should I only create the mesh in C++...
0
votes
2answers
30 views

What does this shader error in Löve2D mean?

What could I've done wrong to get the following error message when trying to create a GLSL shader in Löve2D? I'm sincerely clueless of what the mistake could be, though I suspect the error being a ...
0
votes
1answer
48 views

How to calculate 2D viewport coordinates in a shader?

In Unity, I use the following shader to calculate 2D viewport coordinates : Shader "Foo" { SubShader { Pass { CGPROGRAM #pragma vertex vert ...
1
vote
0answers
15 views

Simple coherent noise function to use in a GLSL shader

I'm looking for a simple (but especially fast) coherent noise function to use it in a shader written in GLSL. I don't need it to be excessively smooth or good looking, I just need that it has the ...
1
vote
1answer
33 views

Unity Surface Shader: Conditinally noforwardadd

I'd like to have this in my shader: #if SHADER_API_MOBILE #pragma surface surf Lambert noforwardadd #else #pragma surface surf Lambert #endif But this tries to compile both #pragma surface and ...
0
votes
1answer
14 views

unity shader : Applying ZOrder to sprite renderer conditionally

here's scene object info of above figure. all of object's renderer is 'SpriteRenderer', and Material is 'Sprites-Default'. [A (Car)] OrderInLayer : 302 Local Z Position : -9.8 [B (Land)] ...
1
vote
2answers
741 views

Using GrabPass for 2D water reflection?

I'm trying to achieve some neat 2d water reflection effect with Unity, something like this: What I've managed to accomplish so far: The problem is GrabPass captures the entire screen but I really ...
0
votes
1answer
30 views

HLSL SetVertexShader Texture2DArray Sample

I want to do some texture samples in the vertex shader, but it seems this cannot be done in the same was as when using the Pixel shader. The code is basically.. Texture2DArray gTexture; VS() { ...
0
votes
1answer
30 views

Opengles 2.0, Replace the black region in the image to make it transparent

I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do? This is my shader language: ...
1
vote
3answers
84 views

Process of writing to the depth texture

In openGL, let's say I output one single point from the vertex shader with this value gl_Position = vec4(2.0,3.0,5.0,7.0); what exact math operations happen to "z" after leaving the vertex shader? ...
-6
votes
1answer
63 views

Is this shader can exist in Unity?

'Front' and 'back' are all SpriteRenderer. Do you have a Shader these things that will be present in the Unity?
0
votes
1answer
30 views

Gaussian blur spritesheet/texture atlas without clipping edges

I'm trying to apply a Gaussian blur to a shadow to soften them a bit. I can apply the blur fine, but the problem is that I end up with this: Instead of this: Which isn't great. The image is part ...
0
votes
2answers
762 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
0answers
38 views

How do I make an object not appear grey regardless of distance?

My moon texture is on a plane 500m away and I would like to know if there is a way to keep displaying the texture: As opposed to it turning grey as pictured here: regardless of the distance it is ...
3
votes
2answers
718 views

Stencil based mask with alpha

I'm trying to create a fog effect like civ 5: I tried creating a StencilSet shader that receives a mask and sets the stencil buffer to 1. I would render the following on every unexplored tile using ...
1
vote
0answers
14 views

OpenGL ES 2.0 not drawing images with shadows

I'm using OpenGL ES 2 to program a simple game 2D for Android mobile phones. I'm coding the rendering portion of the software, using the GLES20 default library. All my sprites are rendered from a ...
2
votes
1answer
313 views

Run HLSL in C++ Basic Sample

I'm considering the idea of taking shaders written in HLSL and running them in an AviSynth plugin to process videos. This would allow accessing various shaders, and also to have GPU acceleration. I'm ...
0
votes
2answers
804 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 System....
1
vote
1answer
34 views

Dynamic Shader Linkage in DirectX12?

Do the dynamic shader linking concepts introduced in DirectX11 ShaderModel 5.0 still work in DirectX12? In the documentation the reflection API is still available (e.g. ID3D12LibraryReflection), ...
2
votes
1answer
100 views

Second pass in multipass effect is ignored

I am trying to render my vertecies in 2 passes, but it seems I am doing something wrong, because only one pass applying. I cannot make the second one work despite that second pass is applying. Here ...
1
vote
1answer
98 views

libGDX upload z-axis of sprite to graphics card

Background: I want to obtain each fragments position via vertex interpolation to then calculate the light vector for phong shading (L = [Fragment pos] - [light source pos]). Problem: At the moment I ...
0
votes
1answer
25 views

Unity 5 - Importing models with multitextured materials

I have a file Blender model of a tree. It consists of some branches and lots foliage, nothing unusual. The foliage consists of a single material, which consists of 2 textures, a diffuse and lower ...
2
votes
2answers
128 views

HLSL texture not reading from register S1

I made a simple post processing shader, that draws scanlines. This all works perfectly. I wanted to make it a bit more interesting by applying a shadowmask instead so I wanted to pass a texture to the ...
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 ...
0
votes
1answer
560 views

Will Vulkan Kill the use of GLSL? [closed]

After reading this link I am still unclear as to the shading language support in Vulkan. As Vulkan only supports SPIR-V is it the case that GLSL is therefore being phased out? Are there any ...
1
vote
1answer
532 views

VertexColor shader is not working correctly in built application

I want to change the vertex colors of my mesh. The light sources must not affect the objects with this shader, its lighting must be determined only by its vertices colors, so I turned the Lighting Off....
0
votes
1answer
74 views

FindNextValidTechnique fails

My effect file compiles successfully, but FindNextValidTechnique fails. Technique part of the shader: technique Diffuse { pass Pass0 { VertexShader = compile vs_2_0 VertexShaderMain()...
3
votes
1answer
48 views

Matte reflection effect in Unity?

I'm trying to achieve that kind of scene but in real time using Unity. It's basically composed of some primitives, a skybox, and a plane. I'm intrigued on how to do this effect in particular: ...
2
votes
1answer
172 views

Unity5 - A Shader to blur far plane edges?

I need some help. In my Unity5 game I'm using two cameras, First camera renders the actual terrain and game objects (wich has a far plane of a 1000 units) and the Second camera renders a 3d skybox of ...