Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:56:33+00:00 2026-06-18T07:56:33+00:00

Is it forbidden to change the value of an in-variable inside a fragment shader?

  • 0

Is it forbidden to change the value of an in-variable inside a fragment shader? The following code crashes exactly when I try to set a new value to “doseValue” :

const GLchar *point_fragment_shader =
"#version 420\n"
""
"/* Per Fragment Input Attributes */"
"in float doseValue;"
"in float alphaValue;"
"in vec2  displayUncertaintyByChangedColor;"
""
"/* Uniform Attributes */"
"uniform float minDisplayDoseValue;"
"uniform int   pointVisualizationMode;"
""
"/* Per Fragment Output Values */"
"out vec4 out_color;"
""
"void main()"
"{"
"   "
"   /* Discard all Points whose dose value is below the minimum */"
"   if(doseValue < minDisplayDoseValue)"
"   {"
"       discard;"
"   }"
"   else"
"   {"
"       if(displayUncertaintyByChangedColor.x == 1.0)"
"       {"
"           doseValue = 500.0;"
"       }"
" ..."

Inside the vec2, the first component is 0.0 or 1.0, the second is some floating point number. If I set up a new variable and initialize it with some arbitrary value inside the second if-statement, there’s no error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:56:35+00:00Added an answer on June 18, 2026 at 7:56 am

    GLSL 4.20 spec, Page 38, Section 4.3.4: Input Variables:

    Shader input variables are declared with the storage qualifier in. They form the input interface between previous stages of the OpenGL pipeline and the declaring shader. Input variables must be declared at global scope. Values from the previous pipeline stage are copied into input variables at the beginning of shader execution. Variables declared as inputs cannot be written to during shader execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I make the following url forbidden in apache; main/index.php?site=ing I have tried
Suppose following class Structure: inside namespace a public abstract class A { protected int
UPDATED I'm trying to programmatic-ally set a COM+ component's ConstructorString with a value for
Eclipse's default template for new types (Window > Preferences > Code Style > Code
I try to run code from this site http://stunningco.de/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/ but I have a problem,
When I try to commit my changes with TortoiseSVN I am getting the following
Occured error(return 403 Forbidden) when upload a Photo without metadata to Picasa web album.
My page showing error forbidden access error, when I post some html and javascript
Why is it forbidden to call Extension Method with ref modifier? This one is
Accept is not listed in the forbidden headers in the documentation here: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLRequestHeader.html but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.