Questions tagged [shader]

A shader is a program to perform calculations on geometry or pixel data in computer graphics.

A shader is a program to perform calculations on geometry or pixel data in computer graphics. With the rapid progress and availability of consumer GPUs during the last decade, an initially software-only solution for high-end RenderMan workstations became widely available. Today, the term is mostly associated with , , , or , which allow convenient, hardware agnostic high-level programmability on consumer GPUs.

6931 questions
2
votes
1 answer

Issues with Z-axis rotation matrix in glsl shader

I've recently began putting together an OpenGL ES 1.1/2.0 2D pipeline from the ground up (iPhone only). This pipeline is intended to be used by engineers with no 3D math experience. Commented out are the X and Y axis rotation matrices that produce…
2
votes
0 answers

Encoding geometry information for Sub-Pixel Shadow Mapping

I'm trying to implement the SPSM approach described in this paper: http://jmarvie.free.fr/Publis/2014_I3D/i3d_2014_SubPixelShadowMapping.pdf First, why am I trying to do this: I am currently using a shadow map, rendered from the viewpoint of a…
2
votes
2 answers

Get/Set Time value from Unity shader Graph

I have creating a pulsating shiny effect with the following as nodes: Abs(Time * speed) => sine I have an oscillating value between 0 and 1 but the problem is that the value may start from anything between 0 and 1 depending on the Time value. I am…
fafase
  • 467
  • 3
  • 10
2
votes
1 answer

OpenGL glfw unable to draw a point using shader

I'm using GLFW for window context creation. I have a procs.hpp file that just loads the required opengl functions (like glCreateShader, glCreateProgram etc) using glxGetProcAddress. The program compiles successfully but there is no point on screen…
Omkar76
  • 1,317
  • 1
  • 8
  • 22
2
votes
1 answer

Optimize OpenGL Fragment Shader

I have a vertex/fragment shader that draws a rectangle performing many calculations based on a texture. (It blends pixels, modifies them, etc). The thing is that each rectangle and the pixels it contains will not change. I only move the entire…
Amandeep Grewal
  • 1,801
  • 3
  • 19
  • 30
2
votes
1 answer

Change color in GLSL shaders

I am trying to modify the color of a 3d model (three.js) which uses GLSL shaders (frag and vert files). To be honest I am not experienced at all with shader language. .frag file precision highp float; uniform sampler2D uTexture; varying vec2…
2
votes
1 answer

GLSL store recurrent data in constant arrays

I'm pretty new to shaders and I have trouble understanding what can be done what cannot. For example, I have a 3d voxel terrain. Each vertex has 3 info: its position, its color, and its normal. The position is pretty much unique to each vertex, but…
Thibault Abry
  • 156
  • 10
2
votes
1 answer

Why is GL_MAX_ARRAY_TEXTURE_LAYERS much smaller than GL_MAX_TEXTURE_SIZE?

For texture sizes greater than GL_MAX_ARRAY_TEXTURE_LAYERS, I have to use an array of single textures instead of one texture array. No problem for me. I'm just wondering whats the reason behind making GL_MAX_ARRAY_TEXTURE_LAYERS so much smaller than…
Meldryt
  • 99
  • 1
  • 9
2
votes
2 answers

SDL 1.3: How to render video with out displaying it?

So what I need is simple: Imagine we have no gui at all - ssh access to some linux where we gonna build and host our app. That app would generate video stream. We have some SDL app with OpenGL shader in it. All we want is to get rendering (as…
Rella
  • 65,003
  • 109
  • 363
  • 636
2
votes
1 answer

Apply gradient to BufferGeometry vertices

I have an animation that uses a BufferGeometry to create a grid of particles which are then animated using Perlin noise. That all works perfectly but the final thing to do is to apply a gradient across the grid. I have tried everything I have found…
JJ Gerrish
  • 812
  • 1
  • 10
  • 25
2
votes
1 answer

OpenGL in Dart not showing triangle

I've written a simple "hello word triangle" in OpenGL/C++, it works perfectly. Then, when i was sure that the code worked, I decided to switch to dart and convert all my code. These are the the pulgins that i've used: OpenGL - GLFW(mingw x64…
2
votes
1 answer

sampling GL_DEPTH_COMPONENTs of type GL_UNSIGNED_SHORT in GLSL shader

I have access to a depth camera's output. I want to visualise this in opengl using a compute shader. The depth feed is given as a frame and i know the width and height ahead of time. How do I sample the texture and retrieve the depth value in the…
Edward
  • 468
  • 4
  • 18
2
votes
2 answers

How to get "round_z" in asm code by HLSL?

When I'm reading the asm code ,I dont know how to get the instruction "round_" just below. Which function should I use in HLSL to get it? Or had it be replaced with the update of versions? The following is asm code:round_z r15.x
2
votes
1 answer

OpenGL PyQt object not scaling

I have just translated my old glBegin and glEnd code into one using VBOs and VAOs. As framework, I am using Pyqt. I did managed to load a 3D object and to display it on the screen, but I can not scale it. I tried after glLoadIdentity in paintGL…
user14182222
2
votes
1 answer

Why does changing the scale of my object break its child's shader?

I have a player game object. Whenever I change direction, I flip the player's x scale, so it's 1 when he's facing right and -1 when he's facing left. This code is responsible for flipping the player scale and moving the player horizontally: void…
Seminix
  • 97
  • 9
1 2 3
99
100