BitmapNoise don't look the same in preview and release mode

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

BitmapNoise don't look the same in preview and release mode

Post by Ats »

Hi. Yesterday I spent quite some time tweaking BitmapNoises in preview mode to get what I want. But today, the result is a blurry mess. Turns out that preview and release doesn't show the same thing...

Here's the simple test:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
  <OnRender>
    <UseMaterial Material="MyMaterial"/>
    <RenderMesh Mesh="MyMesh"/>
  </OnRender>
  <Content>
    <Bitmap Name="MyBitmap" Width="256" Height="128">
      <Producers>
        <BitmapNoise Name="Noise" Octaves="2" Offset="0.1" Persistence="20" ZHeight="185.1705" Color="1" Tile="255"/>
      </Producers>
    </Bitmap>
    <Material Name="MyMaterial">
      <Textures>
        <MaterialTexture Texture="MyBitmap" TexCoords="1"/>
      </Textures>
    </Material>
    <Mesh Name="MyMesh">
      <Producers>
        <MeshBox Scale="4 2 1" Grid2DOnly="255"/>
      </Producers>
    </Mesh>
  </Content>
</ZApplication>
This is the preview:
noise_preview.png
noise_preview.png (37.78 KiB) Viewed 6756 times
And this is the result:
noise_release.png
noise_release.png (45.79 KiB) Viewed 6756 times

It looks like the Persistence of the BitmapData is limited to [0,1] in release.
The same goes for Offset.
Last edited by Ats on Wed May 19, 2021 1:50 pm, edited 1 time in total.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: BitmapNoise don't look the same in preview and release mode

Post by VilleK »

Actually both Offset and Persistence are supposed to be in the 0 to 1 range. When you use the slider then they have that limit. But it seems there is no check for typing in larger values.

When you save to executable then the values are forced into that range.
User avatar
Ats
Posts: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: BitmapNoise don't look the same in preview and release mode

Post by Ats »

Oh, all right. So how could I obtain the same result when it is clamped to 0,1 ?
Maybe with some kind of advance technique using a BitmapExpression. But isn't that longer to calculate?

Something like Pixel.R = round(Pixel.R); but a bit more subtle, or followed by a BitmapBlur...


Edit:
Pixel.R = 1/(1+pow(20,60*(0.5-Pixel.R))); :D
Post Reply