Logo by DsyneGrafix - 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: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 28, 2024, 11:08:09 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 3 4   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: Problem with maps  (Read 5375 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: November 21, 2015, 02:23:36 AM »

I've got a problem.
I am using simple IBL in my tracer with equirect mapping.

IBL is just one of the components contributing to final color. There are other lights.
Now what happens is that whenever I turn on IBL maps so that they're mixed into the light, a weird thing happens. Even if IBL contributes to total light at tiny little percent, I am getting artifacts.
It looks like for some reason the image renders pixelated in 2x2 blocks.
Sub sampling and all biases still work on a pixel level, but they converge towards 2x2 pixel blocks.
And it has nothing to do with the resolution of my map - I.e I am not seeing insufficient map res.
This is even more visible on edges of objects which look sort of aliased.
I don't think it's something obvious with the tracer, rather some internal GL Magic.

Any ideas?
I'll try to post some examples tomorrow.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #1 on: November 21, 2015, 04:07:21 AM »

Code, need code to test, if your fragments compile with warnings fix them first, there are all kinds of things that can contribute to the problem so eliminate the narrowing, implicit cast and may be used uninitialized warnings, that is where I would start wink when you are sure that the problem is not with the fragment code then it will be easier to track down.
As this is the first I've heard of this and the texture stuff in the latest version is (essentially) the same as github Fragmentarium-master I would be asking myself "when did this start and what changed at that time".

The default "internal GL Magic" for textures is...
Code:
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
...which is always used for rendering the fragment generated image with the buffershader

to change the default behaviour you can add #TexParameter textureName param option
valid params GL_TEXTURE_WRAP_S GL_TEXTURE_WRAP_T GL_TEXTURE_MIN_FILTER GL_TEXTURE_MAG_FILTER
valid options  GL_CLAMP GL_REPEAT GL_NEAREST GL_LINEAR

the mipmap option works like this...
Code:
uniform sampler2D myTexture; file[test.png]
#TexParameter myTexture GL_TEXTURE_MAX_LEVEL 1000
#TexParameter myTexture GL_TEXTURE_WRAP_S GL_REPEAT
#TexParameter myTexture GL_TEXTURE_WRAP_T GL_REPEAT
#TexParameter myTexture GL_TEXTURE_MAG_FILTER GL_LINEAR
#TexParameter myTexture GL_TEXTURE_MIN_FILTER GL_LINEAR_MIPMAP_LINEAR

parameters and options set this way will be applied to the named texture whenever it is used, this is about all I can tell you about the internal texture stuff, I'm not a GL guru, still learning, enlightenment is always welcomed.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #2 on: November 21, 2015, 04:49:54 PM »

Some GLSL operations operate on 2x2 screen space pixel blocks. For instance the dFdx function, which is also used by all mipmapping functionality. So make sure to disable mipmapping (though the default should be to disable it, as 3dickulus write above).
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #3 on: November 21, 2015, 06:33:03 PM »

Here's the file of how it looks.
Note the ground which is IBL-lit.
Same happens for tiling imperfection on the sky map.
The seam itself may be a result of some rounding, but the fact its so pixellated points to the same issue.

Logged

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



kizny
WWW
« Reply #4 on: November 21, 2015, 06:50:46 PM »

Some GLSL operations operate on 2x2 screen space pixel blocks. For instance the dFdx function, which is also used by all mipmapping functionality. So make sure to disable mipmapping (though the default should be to disable it, as 3dickulus write above).

How can I do it exactly?
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #5 on: November 21, 2015, 07:59:28 PM »

mipmap is disabled by default internally (C++ side, that's why you need to explicitly use #TexParameter to turn it on)

To disable (this should not be needed!!!)...
Code:
uniform sampler2D myTexture; file[test.png]
#TexParameter myTexture GL_TEXTURE_MIN_FILTER GL_LINEAR
...when this is the only parameter set on a texture mipmap is disabled in GL

as Syntopia states "Some GLSL operations operate on 2x2 screen space pixel blocks. " so...
Code:
grep dFd Fragmentarium/Examples/*/*
....
result:
BufferShader-1.0.1.frag:  vec2 pixelsiz=vec2(dFdx(pos.x),dFdy(pos.y));
DepthBufferShader.frag:   // vec3 n = normalize(cross( dFdx(worldPos), dFdy(worldPos) ));
ZBufferShader.frag:       vec3 n = normalize(cross( dFdx(worldPos), dFdy(worldPos) ));
used in assorted buffershaders, these read the rendered image texture for post processing and final display, afaik these act on the entire image not just one texture in part of the image.

if the effect is only on the edge and not across the entire bg-map then double check your bg-map, then double check your code for an off by 1 err on the x axis?, textures also work "nicer" if they are square and size is  2^n, of course without code and data we can only guess at what the problem might be...

edit: is this a Synthclipse problem or a Fragmentarium problem?
« Last Edit: November 21, 2015, 08:11:36 PM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #6 on: November 21, 2015, 08:28:29 PM »

The seam I have is a synthclipse problem as it is not present when compiled and run with fragmentarium.
The pixellation problem is present regardless of whether I use Sc or Frag.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #7 on: November 21, 2015, 08:44:30 PM »

did you alter the value in the rand() function from 43758.5453 to 3758.5453 to fix banding in IQ-Clouds  huh?
this may affect dither in places
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #8 on: November 21, 2015, 08:49:53 PM »

did you alter the value in the rand() function from 43758.5453 to 3758.5453 to fix banding in IQ-Clouds  huh?
this may affect dither in places

Yeah, batch replaced in all files.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #9 on: November 21, 2015, 09:29:07 PM »

yeah, that's probably the wrong thing to do,
replace only the one that IQ-Clouds uses as this seems to fix banding artefacts,
then,
replace another one and TEST!,
then,
replace another one and TEST! etc...
being mindful of what parts of the render these should affect, until you find the places where this works for removing banding artefacts.

and read https://www.opengl.org/discussion_boards/showthread.php/176425-How-are-dFdx-and-dFdy-functions-implemented for some insight on how the dFd functions work.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #10 on: November 21, 2015, 09:30:56 PM »

OKey,

Here's what I figured out:
- The problem is definitely present only in Synthclipse (although I had experienced it in the past with Fragmentarium at some point and ignored it).
- The problem is caused by the mipmap thing.
i.e
when I set fragmentarium map using the code:

uniform sampler2D myTexture; file[test.png]
#TexParameter myTexture; GL_TEXTURE_MIN_FILTER GL_LINEAR_MIPMAP_LINEAR

It behaves exactly like the problem I am experiencing with synthclipse.
Unfortunately Synthclipse won't let me enter #TexParameter

Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #11 on: November 21, 2015, 09:51:05 PM »

so, to recap...
the tiling seam imperfection on the sky map is not a Fragmentarium problem because it renders correctly in Fragmentarium.
the pixelation problem, also not a Fragmentarium problem but was caused by your global changes to the rand() function.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #12 on: November 21, 2015, 10:46:42 PM »

the tiling seam imperfection on the sky map is not a Fragmentarium problem because it renders correctly in Fragmentarium.
Correct. It was caused by enabled MIPMAP in Synthclipse.
Fixed by disabling it.

the pixelation problem, also not a Fragmentarium problem but was caused by your global changes to the rand() function.
No, that was NOT caused by that. It was caused by the same issue as above - enabled MIPMAP


Thanks for help!
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #13 on: November 21, 2015, 11:59:48 PM »

Aside: that rand() function is a terrible hack to begin with, and the hacked version is even more dubious with the the lower frequency. If you think about what a random number function does / what you want from it, this function can never work properly...

A basic random number gen can be done in little state with eg xorshift.
Logged

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



WWW
« Reply #14 on: November 22, 2015, 01:06:33 AM »

@lycium can you make a rand() function for frags using "little state with eg xorshift"  that works better than the current hack? Fragmentarium users would be most appreciative smiley
@patryk so you have reverted to the original value, 43758.5453, everywhere and used 3758.5453 with IQ-Clouds only and the pixelation still exists when mipmap is disabled (default) ?

I do have something you can test, but only in source right now, so far it looks like I will leave it in for the next patch release...

added other mipmap parameters...
GL_LINEAR_MIPMAP_LINEAR
GL_LINEAR_MIPMAP_NEAREST
GL_NEAREST_MIPMAP_LINEAR
GL_NEAREST_MIPMAP_NEAREST

and
GL_TEXTURE_MAX_ANISOTROPY

you will find these in the Edit->Insert commands menu

these images are both at the same location and only render 1 subframe using a 2x2 texture

image 1 ansiotropy set @ 1.0 = isotropic (no filter)
image 2 ansiotropy set @ 16.0 = maximum mipmap filtering on my card

so, the mipmap functions and filtering seems to work


* ansiotropic-1.0.png (20.64 KB, 320x200 - viewed 279 times.)

* ansiotropic-16.0.png (91.87 KB, 320x200 - viewed 310 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Pages: [1] 2 3 4   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Julia Set Maps Images Showcase (Rate My Fractal) HPDZ 9 2421 Last post May 25, 2011, 09:12:01 AM
by Pauldelbrot
And some more new maps Mandelbulb 3d skyzyk 10 2223 Last post October 06, 2011, 09:29:13 AM
by DarkBeam
Maps not working Mandelbulb 3d Catelee2u 3 1783 Last post January 02, 2012, 11:26:46 AM
by Sockratease
Color Maps Mandelbulb 3d « 1 2 » Fractacular 22 7726 Last post April 10, 2012, 06:17:55 PM
by Alef
Maps? Mandelbulb 3d mary032964 5 2323 Last post July 13, 2012, 09:55:44 PM
by mary032964

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