Skip to main content
Participant
March 3, 2014
Answered

Texture LOD bias usage with cube textures

  • March 3, 2014
  • 1 reply
  • 3146 views

Hi guys,

I’ve tried texture LOD bias.

From AGAL bytecode format page:

B = Texture level-of-detail (LOD) bias, signed integer, scale by 8. The floating point value used is b/8.0 (8 bits)

All is ok, if I use high LOD bias values with cubemap. You can see my demo with MacBook

I’ve prepared a demo for you https://www.dropbox.com/s/w0i9kbrabxbnr0a/lodTest.swf

You can change Sky Bias values(for diffuse and specular) and see the artifacts like:



Also you can change 2d map biases(diffuse, specular, normal) and everything is smooth:

the same thing with compressed textures. I’ve tested it with Windows and iOS platforms.

I have two questions:

1) Is it possible to achieve the same smooth effect with cube textures? What does cause those artifacts?

2) It would be great to have the next opportunity. for instance, I have texture map with LOD bias values, so, I want to sample it and then pass this value in the next texture sampling opcode tex. What do you think?

Thank you!

This topic has been closed for replies.
Correct answer jeromiec83223024

Just recapping the thread from the bug to close this out:

Texture level-of-detail (LOD) bias in AGAL reference:

  1. DirectX: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476207(v=vs.85).aspx  see MipLODBias
  2. OpenGL: https://www.opengl.org/wiki/Sampler_(GLSL)    see bias
  3. D3D: "Offset from the calculated mipmap level.
    For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5."

1) Is it possible to achieve the same smooth effect with cube textures? What does cause those artifacts?

We don't understand what the artifacts are in your demo. Setting "Sky Diffuse Bias" to 128 exceeds the bound of an 8-bit signed integer, which creates a large difference.

2) It would be great to have the next opportunity. for instance, I have texture map with LOD bias values, so, I want to sample it and then pass this value in the next texture sampling opcode tex. What do you think?

This not currently possible using AGAL because it's a constant.  We would like introduce the tex-lod instruction in a future version, which would allow to control the mipmap level using a variable in AGAL; however, we cannot commit to a date at this time.

Thanks!

1 reply

jeromiec83223024
Inspiring
March 14, 2014

Thanks for the report. 

I've file the following bug on your behalf and escalated it to our graphics team:  

https://bugbase.adobe.com/index.cfm?event=bug&id=3724147

jeromiec83223024
jeromiec83223024Correct answer
Inspiring
April 14, 2014

Just recapping the thread from the bug to close this out:

Texture level-of-detail (LOD) bias in AGAL reference:

  1. DirectX: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476207(v=vs.85).aspx  see MipLODBias
  2. OpenGL: https://www.opengl.org/wiki/Sampler_(GLSL)    see bias
  3. D3D: "Offset from the calculated mipmap level.
    For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5."

1) Is it possible to achieve the same smooth effect with cube textures? What does cause those artifacts?

We don't understand what the artifacts are in your demo. Setting "Sky Diffuse Bias" to 128 exceeds the bound of an 8-bit signed integer, which creates a large difference.

2) It would be great to have the next opportunity. for instance, I have texture map with LOD bias values, so, I want to sample it and then pass this value in the next texture sampling opcode tex. What do you think?

This not currently possible using AGAL because it's a constant.  We would like introduce the tex-lod instruction in a future version, which would allow to control the mipmap level using a variable in AGAL; however, we cannot commit to a date at this time.

Thanks!

Participant
April 15, 2014

Hey Jeromie,

Thank you for the response.

We don't understand what the artifacts are in your demo. Setting "Sky Diffuse Bias" to 128 exceeds the bound of an 8-bit signed integer, which creates a large difference.

I've created a screencast for you http://screencast.com/t/x8KEuNtykysS with the issue. I just want to remove these crazy lines from the surface. Is the issues on my side? I just sample texel from cubemap with LOD constant value. Should I sample it in special way?

Thanks!