Crist-JRoger
|
|
« 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 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
|
|
|
Logged
|
|
|
|
Patryk Kizny
|
|
« 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
|
|
« Reply #2 on: April 26, 2016, 04:27:10 PM » |
|
I think i chose third point Because i'm too far from scripting and Synthclipse 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 Ray.Direction.xy works well, but DoF not activated on background )
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« 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 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
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« 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 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
|
|
« 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
|
|
|
|
Crist-JRoger
|
|
« Reply #6 on: April 27, 2016, 02:54:33 PM » |
|
Wait wait IBL-Raytracer works well and there is the same order.
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #7 on: April 28, 2016, 08:13:30 PM » |
|
Okay I found 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.
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« 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
|
|
« 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 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 Such a great news!
|
|
|
Logged
|
Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
|
|
|
Patryk Kizny
|
|
« 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
|
|
« 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
|
|
« 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
|
|
« 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 it is not sapmler2D, it is vec2. Can you show how it will be?
|
|
|
Logged
|
|
|
|
SCORPION
|
|
« Reply #14 on: May 05, 2016, 01:39:05 AM » |
|
Сергей, я тебя понял, но совершенно не понимаю, зачем это надо? И уж совершенно не представляю, как это реализовать на практике - рейтрейсеры то для 2D и 3D разные - как ихсвалить в общую кучу? Всё таки проще сначала сделать 2D фрактал, затем вставить фоном в 3D проект....
|
|
|
Logged
|
|
|
|
|