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

Render object with different shader depending on the camera

I have an object with a custom shader. When it is being rendered by cameraA, then I want it to render a particular way (ex red). When it is rendered by another cameraB, I want it to render a different ...
4
votes
1answer
220 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 ...
2
votes
1answer
65 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
17 views

How can I pass a texture to a custom deferred lighting model in Unity?

I've replaced the Internal-DeferredShading.shader with my own shader, and it's working fine, but I want to add a uniform texture for it to sample from. I've tried adding a texture as a property and ...
1
vote
1answer
36 views

Disney BRDF - where is metallic factor input into BRDF?

Burley states about metallic parameter: "This is a linear blend between two different models. ..." What are the two models? I can't see this described in the Frostbite or the Unreal papers either. ...
1
vote
1answer
47 views

Combining skydome and fog

I am developing a 3D game in DarkBASIC Professional, and I have a theoretical problem with the combination of skydomes and fog in general. My question is not specific to a programming language, so I ...
2
votes
0answers
22 views

Simple square vertex lifting shader

I am trying to rebuild the fur effect in Viva Pinata. Here each square becomes a pattern of fur I imagine the process to be like this... U lift one end of the triangles. Now I need to ...
1
vote
1answer
125 views

Making Cave system in Unity 5

I know there are many threads about this but none of them seems to work for me and I spent like 2 days already on that problem. Things that I've checked: http://wiki.unity3d.com/index.php/...
3
votes
1answer
58 views

How do I pixelate a scene with SceneKit and Metal, in Swift?

I managed to get pixelation working by using the OpenGLES2 rendering API, and a CIFilter. But it was way too slow, so I want to use the Metal API and just have a very simple filter that pixelates ...
1
vote
1answer
159 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 ...
35
votes
4answers
37k views

Using multiple shaders

I'm currently studying opengl shaders but I can't figure out something: how to apply different shaders to the objects, for example, a teapot rendered using toon shader and another one in the same ...
3
votes
1answer
51 views

Per-Texel lighting? (not per-vertex or per-pixel)

In my game, I have a 3D shader that does lighting using color ramps on models with very low resolution textures. Basically, the vertex shader calculates color values for direct light and ambient ...
1
vote
1answer
32 views

Check if vertex is visible in shader

Im trying to figure out when a vertex is visible from the main camera. I have this function: bool in_frustum(float4x4 M, float4 p) { float4 Pclip = mul(M, float4(p.x, p.y, p.z, 1.0)); ...
3
votes
0answers
19 views

LibGDX: Shader files in assets - Access is Denied

I stored the glsl files in android -> assets -> shaders directory, but when I run the app, an error is displayed: Error:Gradle: Execution failed for task ':android:mergeDebugAssets'. Error: ...
1
vote
2answers
58 views

How to write from shader to a texture to a PNG in Unity?

I want to write the information from my shader into a texture and save it in a png. I found this: http://forum-old.unity3d.com/threads/save-texture-generated-by-a-shader.326561/ and this System.IO....
1
vote
1answer
29 views

Unity / Passing an array in a shader

I want to pass my array (which is inside my c# code) to my shader. Shader "custom/shader4" { Properties { _myArray("Array", Float[256]) = [] } SubShader { Pass ...
0
votes
2answers
780 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 ...
1
vote
3answers
88 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? ...
0
votes
1answer
37 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: ...
2
votes
1answer
55 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
37 views

Unity / How to add a shader to a material via c# script?

I found already some things - but those seem not quite what I need. (perhaps outdated functions?) https://docs.unity3d.com/ScriptReference/Material-shader.html here, it seems you can add a shader to ...
2
votes
1answer
333 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 ...
1
vote
1answer
40 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), ...
3
votes
0answers
67 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader #version 450 core layout(triangles) ...
1
vote
1answer
559 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....
1
vote
2answers
847 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....
2
votes
1answer
107 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 ...
0
votes
0answers
38 views

Unity / How do I change the color of the “Screen” based on the Object's depth's (as a Screen Effect)?

Yesterday I asked and solved my problem: Unity / How do I change the color of an object based on its depth? Today I tried to change the script(from yesterday) and apply it to the camera and it did ...
0
votes
1answer
91 views

Unity / How do I change the color of an object based on its depth?

The objective here is to change the color of the nearest object. (the nearer the object, the more "colorful" the object gets rendered; and the farther away, the more "grey" the object gets rendered), ...
0
votes
1answer
71 views

How can I duplicate this color/hue shifting effect in C#?

I am looking for a way to duplicate this color shifting effect: I don't think it matters but the starting frame would be this: My instinct was that some type of hue shift is occurring in a way ...
1
vote
1answer
110 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
0answers
19 views

Unity fragment shader. Problem with passing parameters to shader in android version

I have a shader linked to a material which is connected to an object. On runtime I'm trying to change it's parameters( with uniform variables or with properties). On my PC version everything works ...
0
votes
1answer
33 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 ...
1
vote
1answer
57 views

OpenGL nothing being drawn to screen

I am following the book 'OpenGL SuperBible' and am trying to run one of the first examples of drawing a point to the screen, bit instead of using there lib, im using GLFW. I'm not sure where I am ...
0
votes
0answers
9 views

LibGDX Render Mesh

I have a Mesh mesh. I'd like to render mesh. However, its method for doing so is render(Shader shader, int primitiveType). I don't have a shader. To get a shader, the thing to do is new Shader(...
0
votes
2answers
640 views

3D position of an arbitrary UV coordinate

I have a UV map for a 3D mesh that encodes "links" between pairs of UV coordinates. I have previously defined this links (or pairs), one to one. The links are enconded using the function rgb_color(u1, ...
0
votes
0answers
15 views

Unity VR: Possible to render a multiple mesh/material model transparent without seeing innards?

I would like to render a model in VR using Unity. This model consists of multiple meshes, some with different materials. I would like this entire model to fade in and out without having depth sorting ...
1
vote
0answers
18 views

Multi Sampling in Rendering Pipeline?

I am trying to understand : How does multi-sampling rasterization effects pixel shader output? In a nutshell (i am skipping some steps to stay on point of question): Vertex data is fetched. Vertex ...
1
vote
1answer
77 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()...
1
vote
0answers
35 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
56 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
515 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
605 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
324 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
126 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
248 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
124 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
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 ...