Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
31 user(s) are online (15 user(s) are browsing Forums)

Members: 0
Guests: 31

more...
Support us!
Recent OS4 Files
OS4Depot.net





GLSL questions
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1014
Q1) is noise() function supported? Reference: https://www.khronos.org/registry/OpenG ... ages/gl4/html/noise.xhtml

I get a compilation error about "no matching overloaded function found".

   Report Go to top

Re: GLSL questions
Not too shy to talk
Joined:
2015/6/11 9:51
From Cologne
Posts: 331
What you see there is ogles2's internal GLSL-to-SPIR-V compiler (glslangvalidator) complaining about the function not being supported. The reason for this problem is the #version you are using. Try e.g. ""#version 430" and the noiseX function calls will compile. Yes, all that #version hick-hack sucks hard with GLSL.

However, that still won't give you the desired result. I checked the source of the GLSL-to-SPIRV-compiler "glslangvalidator" (which is the reference GLSLcompiler) I use internally (and which is also used for my stand-alone build that ships with Nova) and found that it's handling it as a dummy.

So, what you get is effectively this
float a=/*noise1*/(b);
vec2 c=/*noise2*/(d);
etc.

As far as I can tell from a quick peak into the source even the latest glslangvalidator version doesn't emit anything real.
However, at least some years ago hardware support for the noise function was rare at best, I don't know if anybody implemented it at all, never used it.
The thing is that you can achieve the same if not better results if you implement your own noise function, usually consisting out of a noise-texture-lookup, thus being trivial to do and very fast.

glslangvalidator (or ogles2) could emit self-made noise functions, but a decent noise can be pretty costly, which is why they didn't do it at all, I suppose. So you end up with the above.

_________________
[Facebook] [YouTube Channel]
   Report Go to top

Re: GLSL questions
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2309
@Capehill

The noise*() functions are now officially deprecated, and I've seen warnings to avoid them for years. As Daytona said, hardware support for the noise functions has been pretty rare.

I remember reading years ago that drivers could return a constant value (what GLSLangValidator does), and that would be spec compliant. And so, you cannot rely on this function.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: GLSL questions
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1014
Thanks. Will try noise textures, then.

Q2) I tried to debug that "garbled display" issue which was reported on Mantis, using isinf() and isnan() functions but they were not working either. I don't remember the exact error right now.



   Report Go to top

Re: GLSL questions
Not too shy to talk
Joined:
2015/6/11 9:51
From Cologne
Posts: 331
@Capehill
Quote:
isinf() and isnan()

Nova doesn't support those as of yet.

_________________
[Facebook] [YouTube Channel]
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project