Vary drifting grating contrast
The attached patch makes the alpha_multiplier parameter work to
vary the contrast of the drifting_grating.
Works for me with very light testing (attached example).
M
- 0001-Make-alpha_multiplier-work.patch 2.04 KB
- TestDynamic.xml 1.75 KB
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by mhisted on 28 Jul, 2010 07:23 PM
After thinking about this a bit, I should clarify: this only works when the background is at (0.5, 0.5, 0.5). However, all the gratings have a mean luminance of 0.5, as far as I can tell. So I don't think there are many reasons to use a different color background.
One way to make it work with all backgrounds would be to get the background color and use it to set the RGB values in this patch. However it's probably cleaner to just have the grating blend correctly on the background. Because the texture uses GL_COMBINE (not GL_BLEND), I didn't spend time to figure out how to do that correctly.
Support Staff 2 Posted by Christopher Sta... on 28 Jul, 2010 08:14 PM
Thanks for the patch, Mark. I'll check it out and get back to you.
Chris
3 Posted by Mark Histed on 29 Nov, 2010 11:43 PM
Hi Chris,
Any progress on this? If you have something to test I can pull the nightly and test it.
best
Mark
Support Staff 4 Posted by Christopher Sta... on 30 Nov, 2010 04:39 PM
Hi Mark,
Sorry for ignoring this for so long. I wanted to think about it some more before committing it, but then it completely fell off my radar.
Anyway, the patch seems fine, and I just committed it. It'll be in tonight's nightly build.
For future reference: It's possible to get the same effect by drawing a semi-transparent rectangle over the grating in your experiment. I've attached an example that does this for gray, red, green, and blue backgrounds. If you ever want to adjust the contrast of a grating against a background that's not neutral gray, this is a way to do it.
Cheers,
Chris
5 Posted by Mark Histed on 30 Nov, 2010 08:36 PM
Thank you Chris. I'll look into both options next week and let you know.
6 Posted by mhisted on 08 Dec, 2010 10:30 PM
This all works. Thanks!
One additional comment - can you add some sort of error checking on XML field names in the server? For example, if an XML property name is specified that is unsupported for that object, have the server display an error at parse time. Right now if you set the 'alpha' or 'contrast' or 'alapha_multiplier' field of a rectangle object, those fields are ignored silently.
T hanks!
Mark
7 Posted by David Cox on 09 Dec, 2010 12:04 AM
> One additional comment - can you add some sort of error checking on XML field names in the server?
Big changes / improvements are coming on this front. Stay tuned.
– Dave
Christopher Stawarz closed this discussion on 09 Dec, 2010 01:31 PM.