Logo by mclarekin - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. March 29, 2024, 03:01:48 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: ProvidesInit  (Read 531 times)
0 Members and 1 Guest are viewing this topic.
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« on: November 05, 2016, 09:47:04 PM »

No idea if I am in the right place here, and please bear with me as I really have no clue about GLSL programming  embarrass

At the moment I am having lots of fun trying to get colorpalette.frag working with different raytracers, for now in Knighties PseudoKleinianprogressiveDoF.frag. Got it going in DE-Raytracer (see attachment), and Almost in DE-Kn2cr11.frag (see attachment). In the latter I can #define almost anything except for ProvidesInit. As soon as I define that and build I get an "Could not link fragment shaders"-error. Can't find any info on that error online... No further errors except some warnings about "Implicit casts from float to vec2" from the Wang-Hash-thingy in DE-Kn2cr11.frag

The ProvidesInit sits in the 3D.frag and occurs multiple times
#ifdef providesInit
void init(); // forward declare
#else
void init() {}
#endif

So this - void init(); // forward declare -  is the reason for my problem... or rather, I am the reason for my problem, because I have no clue what this does (throw away all previous stuff/pass it to the next subroutine (yep, that's my level of programming experience... subroutines  rolling on floor laughing))

Can someone be so kind and tell me what ProvidesInit does exactly? I presume some frags need it, but for what?

* PKdof-de-raytracer-palette.zip (2.36 KB - downloaded 52 times.)
* PKdof-palette-kn2cr11-notworkingwellyet.zip (3.19 KB - downloaded 57 times.)
Logged

sabine62.deviantart.com
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #1 on: November 06, 2016, 12:02:18 AM »

#define ProvidesInit in your frag code and add...

void init() {

...some fabulous initialization code...

}

to initialize some step or variables as in this is the first call from main() to setup some things that are needed by your custom routines.

not really needed unless you write some code that explicitly requires this.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #2 on: November 06, 2016, 12:06:42 AM »

Thanks a lot, Dick! smiley I am especially grateful for that last line  wink
Logged

sabine62.deviantart.com
Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.157 seconds with 24 queries. (Pretty URLs adds 0.007s, 2q)