Yet another version of a Tweak OpenGL player. From the package comments:
----- Filename: Tweak-OpenGL-daf.9.mcz Timestamp: 31 July 2007 9:38:22 pm Message: Make some noise! (with a few more shaders.) Requires the OpenGL-OpenGL package from the PublicContribs repository to be installed first. It is necessary to manually do "OGLExtManager initialize" after loading the OpenGL-OpenGL package. The newest OpenGL package from the Hedgehog repository should also be merged. Thanks to Andreas Raab for a big performance boost. This package also depends on a fix for Mantis #6553, which can temporarily be a trivial do-it-yourself thing. Just change VectorColor#asVector4 so that it returns a Vector4 instance instead of a Vector3. Install the 3 packages, do the 2 manual items above, then in Squeak open a Tweak Project Window, get a Workspace from the Tools menu, enter "GPUInfo new chkGLSLSupport" and doIt. If this says that you have GLSL support, then enter "Wrinkle1 open" and doIt. ----- Although the random generator for the noise shaders isn't the best (I didn't fully implement the pseudo-random algorithm because I didn't take the time to figure out how to mathematically do the bit-level operations), it will do for now. Though now I have enough shaders to make it interesting to attempt to combine multiple textures! Here's hoping I don't run into too many GPU limitations right off the bat ... Here are some very interesting free texture tools: http://www.artofillusion.org/docs/texedtut/chapter9 http://www.werkkzeug.com/ http://www.mentalimages.com/2_4_mentalmill/index.html |
Hey David,
I'm trying to get your noise fragment shader to work and I'm running into a couple of issues on this Radeon x1600 Mac 10.4.10 hardware/ driver combo and I'm hitting a few issues. Three issues actually, two of them are just places where integer and floating point conversion should be occurring (eg float(anInt)) which is no problem, but the bigger one is it complains about the massive numbers (when it comes to integers my card/driver combo can support nothing over 65535, and you've got some numbers in the billions!). Can smaller numbers work? And what hardware are you running on (assuming you're running on hardware)? Cheers, Derek On Aug 1, 2007, at 10:25 AM, David Faught wrote: > Yet another version of a Tweak OpenGL player. From the package > comments: > ----- > Filename: Tweak-OpenGL-daf.9.mcz > Timestamp: 31 July 2007 9:38:22 pm > Message: Make some noise! (with a few more shaders.) > > Requires the OpenGL-OpenGL package from the PublicContribs repository > to be installed first. It is necessary to manually do "OGLExtManager > initialize" after loading the OpenGL-OpenGL package. > > The newest OpenGL package from the Hedgehog repository should also be > merged. Thanks to Andreas Raab for a big performance boost. > > This package also depends on a fix for Mantis #6553, which can > temporarily be a trivial do-it-yourself thing. Just change > VectorColor#asVector4 so that it returns a Vector4 instance instead of > a Vector3. > > Install the 3 packages, do the 2 manual items above, then in Squeak > open a Tweak Project Window, get a Workspace from the Tools menu, > enter "GPUInfo new chkGLSLSupport" and doIt. If this says that you > have GLSL support, then enter "Wrinkle1 open" and doIt. > ----- > Although the random generator for the noise shaders isn't the best (I > didn't fully implement the pseudo-random algorithm because I didn't > take the time to figure out how to mathematically do the bit-level > operations), it will do for now. Though now I have enough shaders to > make it interesting to attempt to combine multiple textures! Here's > hoping I don't run into too many GPU limitations right off the bat ... > > Here are some very interesting free texture tools: > http://www.artofillusion.org/docs/texedtut/chapter9 > http://www.werkkzeug.com/ > http://www.mentalimages.com/2_4_mentalmill/index.html |
Hi Derek,
I'm using an NVidia 5200 GPU, which is pretty much the oldest, smallest thing NVidia makes that supports GLSL shaders. I'm a little surprised that an ATI card has those limits on integers, but it's probably workable some way or another. The big integers are specifically in the Pseudo-Random Number Generator, and have to do with masking and overflowing a 32-bit word. If it needs to work with a 16-bit word for ATI then so be it. I really should rework the PRNG anyway. I hacked up the code from Jerzy Karczmarczuk's Clastic, but he cites Hugo Elias'es noise tutorial (at http://freespace.virgin.net/hugo.elias) as the original source. Actually, the whole idea of doing the PRNG in the shader is not the "usual thing". Most shader noise implementations generate random numbers outside of the shader and store them in a texture which is then accessed by the shader. I've been thinking about implementing another noise shader based directly on Ken Perlin's Java reference implementation, which has the random numbers statically stored in an array in the code. The size of the array is kind of limiting though. The lack of bit-level operations in the (NVidia?) GLSL code is another big limitation on doing PRNG things directly in the shader. I guess I need to try a few other alternatives ... Dave On 8/1/07, Derek Arndt <[hidden email]> wrote: > Hey David, > > I'm trying to get your noise fragment shader to work and I'm running > into a couple of issues on this Radeon x1600 Mac 10.4.10 hardware/ > driver combo and I'm hitting a few issues. > > Three issues actually, two of them are just places where integer and > floating point conversion should be occurring (eg float(anInt)) which > is no problem, but the bigger one is it complains about the massive > numbers (when it comes to integers my card/driver combo can support > nothing over 65535, and you've got some numbers in the billions!). > Can smaller numbers work? And what hardware are you running on > (assuming you're running on hardware)? > > Cheers, > Derek > > On Aug 1, 2007, at 10:25 AM, David Faught wrote: > > > Yet another version of a Tweak OpenGL player. From the package > > comments: > > ----- > > Filename: Tweak-OpenGL-daf.9.mcz > > Timestamp: 31 July 2007 9:38:22 pm > > Message: Make some noise! (with a few more shaders.) > > > > Requires the OpenGL-OpenGL package from the PublicContribs repository > > to be installed first. It is necessary to manually do "OGLExtManager > > initialize" after loading the OpenGL-OpenGL package. > > > > The newest OpenGL package from the Hedgehog repository should also be > > merged. Thanks to Andreas Raab for a big performance boost. > > > > This package also depends on a fix for Mantis #6553, which can > > temporarily be a trivial do-it-yourself thing. Just change > > VectorColor#asVector4 so that it returns a Vector4 instance instead of > > a Vector3. > > > > Install the 3 packages, do the 2 manual items above, then in Squeak > > open a Tweak Project Window, get a Workspace from the Tools menu, > > enter "GPUInfo new chkGLSLSupport" and doIt. If this says that you > > have GLSL support, then enter "Wrinkle1 open" and doIt. > > ----- > > Although the random generator for the noise shaders isn't the best (I > > didn't fully implement the pseudo-random algorithm because I didn't > > take the time to figure out how to mathematically do the bit-level > > operations), it will do for now. Though now I have enough shaders to > > make it interesting to attempt to combine multiple textures! Here's > > hoping I don't run into too many GPU limitations right off the bat ... > > > > Here are some very interesting free texture tools: > > http://www.artofillusion.org/docs/texedtut/chapter9 > > http://www.werkkzeug.com/ > > http://www.mentalimages.com/2_4_mentalmill/index.html > > |
On Aug 1, 2007, at 9:41 AM, David Faught wrote: > > Actually, the whole idea of doing the PRNG in the shader is not the > "usual thing". Most shader noise implementations generate random > numbers outside of the shader and store them in a texture which is > then accessed by the shader. I've been thinking about implementing > another noise shader based directly on Ken Perlin's Java reference > implementation, which has the random numbers statically stored in an > array in the code. The size of the array is kind of limiting though. > The lack of bit-level operations in the (NVidia?) GLSL code is another > big limitation on doing PRNG things directly in the shader. > > I guess I need to try a few other alternatives ... I'd recommend the method described by Marc Olano in "Modified Noise for Evaluation on Graphics Hardware". It seems to strike a good balance between performance and quality. Josh > > Dave > > On 8/1/07, Derek Arndt <[hidden email]> wrote: >> Hey David, >> >> I'm trying to get your noise fragment shader to work and I'm running >> into a couple of issues on this Radeon x1600 Mac 10.4.10 hardware/ >> driver combo and I'm hitting a few issues. >> >> Three issues actually, two of them are just places where integer and >> floating point conversion should be occurring (eg float(anInt)) which >> is no problem, but the bigger one is it complains about the massive >> numbers (when it comes to integers my card/driver combo can support >> nothing over 65535, and you've got some numbers in the billions!). >> Can smaller numbers work? And what hardware are you running on >> (assuming you're running on hardware)? >> >> Cheers, >> Derek >> >> On Aug 1, 2007, at 10:25 AM, David Faught wrote: >> >>> Yet another version of a Tweak OpenGL player. From the package >>> comments: >>> ----- >>> Filename: Tweak-OpenGL-daf.9.mcz >>> Timestamp: 31 July 2007 9:38:22 pm >>> Message: Make some noise! (with a few more shaders.) >>> >>> Requires the OpenGL-OpenGL package from the PublicContribs >>> repository >>> to be installed first. It is necessary to manually do "OGLExtManager >>> initialize" after loading the OpenGL-OpenGL package. >>> >>> The newest OpenGL package from the Hedgehog repository should >>> also be >>> merged. Thanks to Andreas Raab for a big performance boost. >>> >>> This package also depends on a fix for Mantis #6553, which can >>> temporarily be a trivial do-it-yourself thing. Just change >>> VectorColor#asVector4 so that it returns a Vector4 instance >>> instead of >>> a Vector3. >>> >>> Install the 3 packages, do the 2 manual items above, then in Squeak >>> open a Tweak Project Window, get a Workspace from the Tools menu, >>> enter "GPUInfo new chkGLSLSupport" and doIt. If this says that you >>> have GLSL support, then enter "Wrinkle1 open" and doIt. >>> ----- >>> Although the random generator for the noise shaders isn't the >>> best (I >>> didn't fully implement the pseudo-random algorithm because I didn't >>> take the time to figure out how to mathematically do the bit-level >>> operations), it will do for now. Though now I have enough >>> shaders to >>> make it interesting to attempt to combine multiple textures! Here's >>> hoping I don't run into too many GPU limitations right off the >>> bat ... >>> >>> Here are some very interesting free texture tools: >>> http://www.artofillusion.org/docs/texedtut/chapter9 >>> http://www.werkkzeug.com/ >>> http://www.mentalimages.com/2_4_mentalmill/index.html >> >> |
It is a fair possibility that the easiest way to get the (not-too-great) random
generators in these shaders to work would be to just make everything floating point. I have the impression that the NVidia hardware does that anyway. Hopefully in the next few days, I'll have a chance to try out Josh's suggestion for a new noise function. |
In reply to this post by Joshua Gargus-2
Okay, I went ahead and revised the random generators that I had to use
all floats and they work just as good (or bad) as ever, so there is now a newer Tweak-OpenGL package on the Hedgehog PublicContribs repository. Please let me know if this also works for ATI GPUs if you have a chance. I'm still planning on trying Josh's suggestion eventually. I've read Marc Olano's white paper a couple of times and it's starting to sink in ... |
Free forum by Nabble | Edit this page |