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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 25, 2024, 09:52:33 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] 2   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: 2D fractal as background for 3D  (Read 1899 times)
Description: use 2d scripts as background for 3D fractals
0 Members and 1 Guest are viewing this topic.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« on: April 26, 2016, 03:07:23 PM »

There is one of ideas - put 2d fractal into 3d scene as background. Now i trying to do it by myself and will show... when there will be something to show  grin 
I used equiRectangular for 2d transpose into the sphere. I think there will be good results with Sky or GI renderers. And more diversity for animation  smiley
Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #1 on: April 26, 2016, 03:50:25 PM »

You can render to stills and put as background dynamically via qscript.
The other option is going for Synthclipse where you can mix shaders. And use output of one into another.
Or you can implement 2 things into one shader.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #2 on: April 26, 2016, 04:27:10 PM »

I think i chose third point  wink  Because i'm too far from scripting and  Synthclipse shocked
Just copied code from 2D fractal and call vec3 backColor = 2Dfractal(vec2 pos); Strange... and it's work!
And now i search what will be vec2 pos  undecided  Ray.Direction.xy works well, but DoF not activated on background )
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #3 on: April 27, 2016, 02:12:44 AM »

can you use jitter with 2Dfractal(vec2 pos); to get a DOF like "effect" ? fuzz it a little or maybe the antialias code could add some blur wink

just a heads up, v1.0.24 removes unused sliders and stuff, so, if you add one it won't show up in the variable editor until you actually make use of it in the frag code, a group tab will show up but won't get populated if the vars are optimized out by the GPU compiler, I recall PK requested this, I'm working on hiding the empty tabs too A Beer Cup
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #4 on: April 27, 2016, 10:02:51 AM »

can you use jitter with 2Dfractal(vec2 pos); to get a DOF like "effect" ? fuzz it a little or maybe the antialias code could add some blur wink
Why standard DoF don't works?

upd. Quickly tested IBL-Raytracer - DoF works on background.
If I simply called vec3 backColor = equirectangularMap(tex, Ray.Direction); in De-Kn2 it don't works
And Patryk Kizny's DE has the same issue.
So how correctly call background texture in DE-Kn2?
« Last Edit: April 27, 2016, 01:57:36 PM by Crist-JRoger » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #5 on: April 27, 2016, 02:35:04 PM »

I think it's the order, who's first, DOF or background,

I find that clouds obscure fog but fog does not obscure clouds (much) and when order is swapped,
USE_IQ_CLOUDS code before KN_VOLUMETRIC code in color(SRay Ray)
fog obscures clouds and clouds do not obscure fog.

same thing with DOF? order is important
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #6 on: April 27, 2016, 02:54:33 PM »

Wait wait  grin IBL-Raytracer works well and there is the same order.
Logged

Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #7 on: April 28, 2016, 08:13:30 PM »

Okay I found  smiley
Code:
vec3 backColor = equirectangularMap(Background, Ray.Direction+Ray.Offset);
Simply and I don't know how set the focus to background )) It does not matter, but it would be nice for full DoF control on background.





* DE_bg_DoF.jpg (54.36 KB, 640x400 - viewed 118 times.)
Logged

Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #8 on: April 29, 2016, 11:59:33 AM »

Got a question... there is equirectangular map from IBL-Raytracer:
vec3 equirectangularMap(sampler2D sampler, vec3 dir) {   
   dir = normalize(dir);
   vec2 longlat = vec2(atan(dir.y,dir.x),acos(dir.z));
    return texture2D(sampler,BackRot+longlat/vec2(2.0*PI,PI)).xyz;
}
How rewrite sampler2D for vec2 finction?
Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #9 on: April 29, 2016, 07:55:12 PM »

can you use jitter with 2Dfractal(vec2 pos); to get a DOF like "effect" ? fuzz it a little or maybe the antialias code could add some blur wink

just a heads up, v1.0.24 removes unused sliders and stuff, so, if you add one it won't show up in the variable editor until you actually make use of it in the frag code, a group tab will show up but won't get populated if the vars are optimized out by the GPU compiler, I recall PK requested this, I'm working on hiding the empty tabs too A Beer Cup


Such a great news!
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #10 on: April 29, 2016, 07:58:41 PM »

Got a question... there is equirectangular map from IBL-Raytracer:
vec3 equirectangularMap(sampler2D sampler, vec3 dir) {   
   dir = normalize(dir);
   vec2 longlat = vec2(atan(dir.y,dir.x),acos(dir.z));
    return texture2D(sampler,BackRot+longlat/vec2(2.0*PI,PI)).xyz;
}
How rewrite sampler2D for vec2 finction?

if you have an equirectangularly mapped image, there's no need to transform vector. Just use X/Y as long/lat coordinates and it'll work.

If you want to use flat maps, there's no need to map anything. Just sample coordinates straight off.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #11 on: April 29, 2016, 08:16:41 PM »

I have 2D fractal with x and y. I want put it in background for 3D scene. So i need some function vec3 backColor = 2Dfractal(vec2 xy, vec3 dir). dir = Ray.Direction+Ray.Offset
So I don't have such knowledge of GLSL to write it by myself. Now I got results with calling vec3 backColor = 2Dfractal(Ray.Direction.xy) and it looks not bad, but it's wrong code.
Without equirectangular it looks stretched and smooth.
Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #12 on: April 29, 2016, 09:26:21 PM »

Dig my tracer. There's already a simple 2D background implemented and for sure there's code for what you want to do.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #13 on: April 29, 2016, 09:45:38 PM »

I understand how put picture file to background and got it. The question is about 2D fractal  smiley  it is not sapmler2D, it is vec2. Can you show how it will be?
Logged

SCORPION
Conqueror
*******
Posts: 104


« Reply #14 on: May 05, 2016, 01:39:05 AM »

Сергей, я тебя понял, но совершенно не понимаю, зачем это надо?
И уж совершенно не представляю, как это реализовать на практике - рейтрейсеры то для 2D и 3D разные - как ихсвалить в общую кучу?
Всё таки проще сначала сделать 2D фрактал, затем вставить фоном в 3D проект....
Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Background Pics Mandelbulb 3d The Rev 2 2154 Last post October 21, 2010, 06:06:16 PM
by Jesse
Using a picture for background Mandelbulb 3d Sfumato 4 6308 Last post August 07, 2011, 01:09:29 PM
by Sfumato
Transparent Background Mandelbulb 3d « 1 2 » PhotoComix 16 7694 Last post February 11, 2012, 09:32:06 PM
by PhotoComix
background sphere Mandelbulb 3d metalion 8 2066 Last post February 09, 2014, 07:35:40 AM
by JohnVV
background image Mandelbulb 3d irina_escoffery@yahoo.com 3 4444 Last post May 05, 2014, 08:57:16 PM
by IAmThatStrange

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.207 seconds with 25 queries. (Pretty URLs adds 0.014s, 2q)