Home >

Shader uniform variable management

  • Accessing uniform variables from a Cg shader in OpenGLJune 20

    I am trying to implement a simple PC program with OpenGL, using mandatorily Cg shaders (no Unity whatsoever). I have found some tips on this page http://bobobobo.wordpress.com/2008/10/05/cg-1/ and kept the Cgprogram, Cgcontext and Cgprofile types in

  • Linking one uniform variable to many shadersJune 6

    Let's say, that I have 3 programs, and in each of those programs there is a view matrix uniform, which should be the same in all those programs. Right now, when my camera moves, I need to re-upload the modified matrix to every program separately. Is

  • OpenGL + Uniform Variables not reaching shaders + splinesFebruary 6

    I have a very peculiar problem that I can not figure out. For my scene I have created a spline class which I use to generate points for which my camera traverses. This works fine and dandy when I create an instance of the spline class in my scene and

  • GLSL 330 Core Bug? - Uniform variable will not set to value if it is named a certain wayJune 28

    In the code below I have a uniform variable named "vw_matrix" used in the calculation for gl_Position. When I run my program, a rectangle gets printed to the screen. #version 330 core layout (location = 0) in vec4 position; uniform mat4 pr_matri

  • How to get the index of an uniform variable?January 18

    I'm currently writing a function for automatic generation of uniform setters, and because of this I need the information which type an uniform variable has. Now the idea is to use the data type that is stored in the object returned by calling gl.getA

  • How to set shader global variable in sharpdx without using Effect classFebruary 28

    I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. But, in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - constructed directl

  • Best practice for Windows PATH/environment variables managing?June 23

    Right now, it's such a mess. Every time I install a new program that does something trivial in the command line, I have to add it to the path. In fact, I'm developing on Ruby and even gems (plugins/extensions) sometimes have their own executables, an

  • What is the best method to update shader uniforms?June 9

    What is the most accepted way for keeping a shader's matrices up to date, and why? For example, at the moment I have a Shader class that stores the handles to the GLSL shader program & uniforms. Every time I move the camera I then have to pass the ne

  • What is the difference between shader uniforms and attributes in OpenGL?November 14

    I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes. Can uniforms change for each vertex? I mean to calculate the vertex's position in screen space I just multiply the vertex

  • OpenGL Compute Shader UniformsSeptember 4

    I am trying to use a compute shader to generate some data in a texture. My compute shader looks something like this: #version 430 //uniform int u_CurrentMipSize; const int u_CurrentMipSize = 1024; layout( r16f ) uniform writeonly image2D u_densityTex

  • How to assign texture to shader?March 14

    In OpenGL, most shader uniform variables are easy, a float or a vec3 or whatever is associated with a shader program. But samplers are different, we associate a texture unit to the shader program, and associate a texture with a texture unit. To chang

  • How can I animate a portion of the textures on a model?November 15

    I have a model to which I have attached multiple textures. Both textures are currently static, but if I want to move (or slide) the texture which is on the top (in UV space), is that possible? Maybe by moving the texture coordinates or something? ---

  • Efficient manager/controller for uniform and/or attribute variables in a rendering engineAugust 3

    Most engines on the market have their drawbacks and it's difficult to find a simple/light-weight one that's open-source and doesn't have to put you through a rather complex learning process. Writing one is a difficult task on its own, but it might no

  • Game Engine Design – Ubershader - Shader management designJune 22

    I want to implement a flexible Ubershader system (with deferred shading). My current idea is to create shaders out of modules, which deal with certain features (FlatTexture, BumpTexture, Displacement Mapping, -). There are also little modules which d

  • Set a variable inside a GLSL fragment shader that persists for the renderApril 30

    Is it possible to set a varying variable inside a fragment shader and have it persist? I'd like to use the depth component of the first fragment and use it on all the others, making the fragments all flat to the camera. Secondary question: Is it the

  • Does passing uniform constants from technique into shader cause branches?November 21

    I am trying to find a way to organize my evergrowing number of shader techniques/functions (I am coding in sm_3.0). One way is to do this: float4 PS_Crossroads(PS_INPUT input, uniform bool left_right) : COLOR0 { if (left_right) GoLeft(); else GoRight

  • Manage shader parametersFebruary 1

    I'm making some test with OpenGL and I've got a problem with my application design. Currently, I've got something like that in pseudo code: // Ask to draw a given scene. renderer->drawScene( myScene, myCamera ); // Here is what I do in the renderer f

  • WebGL shader program managementApril 29

    I'm writing a tiny WebGL/JS framework to improve my knowledge of JavaScript and WebGL. Following is a class that wraps a Shader Program and provides methods for setting the shader parameters (AKA uniform variables): ShaderProgram class: "use strict&q

  • Managing shaders in OpenGL - A Shader classJune 5

    I've create a basic Shader class in modern OpenGL (3.1) which works perfectly, though it is not feature complete yet. It still lacks the functionality to allow the user registering uniform variables in the shader and update them by calling a method.

  • How to pass a uniform to a shader and what am I doing wrong?January 22

    I'm trying to learn Javascript in WebGL, been trying to scour the internet and read up on it and learning how to use it but I just can't seem to realize what I'm doing wrong, var canvas; var gl; var points = []; var numCirclePoints = 30; var radius =

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 11 q. 0.603 s.