Jump to content
  • Advertisement
Sign in to follow this  
Reyien

OpenGL OpenGl 4.x : passing variable information

This topic is 2344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I am trying to pass information between a vertex shader and fragment shader through the tessellation shaders. Indeed, I am computing lightning and color information in my vertex shader and try to pass through control and evaluator tessellation shaders with struct like :

out-{
vec4 AmbientColorexample;
...etc
}o;

in _{
vec4 AmbientColorexample;
...etc
} i;

and knowing the fact that I have to use array structure for the control and evaluator shader. However, I catch an error on my control tesselation shader info :

" error C7504 : OpenGl does not allow writing to input variable i"

I tried with other variable names but I still have this error. I already have searched on Google and nothing about it so... If someone can explain that problem and tell me if a solution exist, I would be very grateful.

Share this post


Link to post
Share on other sites
Advertisement
I had an error like this on my shaders, I'm not sure if its the same but all I was doing wrong was loading the shader files and forgetting the end character for each line in the file "\n"... This created the exact same error your getting..

so you code above would display as


in _{ vec4 AmbientColorexample;} i;


Which is not an issue untill you add things like "#version 330" or "// test comment" lines into your shaders.

Not sure if this helps but just check the shader data is loaded correctly.

Share this post


Link to post
Share on other sites
At the risk of sounding like a smartass, the clue is there in the error message you get. Input variables are read-only, and you're trying to write to one.

Share this post


Link to post
Share on other sites
LOL Oh yeah, missed that !! But the error does point the the variable "i" which doesn't make sence unless the data is wrong, right ?

What he said :-)

Share this post


Link to post
Share on other sites
oh my god, i was writing to show you my control tessellation code when i saw i[ID].AmbientColor=o[ID].AmbientColor; -__-' shame on me ! so it's compiling but the result is just the opposite that I expected ohmy.png

Anyway thanks for this smartass notification biggrin.png

Share this post


Link to post
Share on other sites
:)

Dumb mistakes like that don't mean that you're dumb. Even someone with 20 or more years of experience will still find themselves doing things like this; it's perfectly normal.

Glad you found it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!