ShaderImage QML Type

シェーダープログラムへのイメージアクセスを提供します。詳細...

Import Statement: import Qt3D.Render 2.8
In C++: QShaderImage
Status: Deprecated

プロパティ

詳細説明

テクスチャの内容をシェーダで読み書きできるようにするには、ShaderImageとして公開する必要があります。テクスチャは複数のミップレベル、レイヤー、フェースで構成できます。さらにShaderImageを宣言することで、テクスチャ・コンテンツのどのレベル、レイヤー、面にアクセスしたいかを指定できます。

ShaderImageが正しく動作するには、Parameterの値として割り当てられ、有効なQt3D.Render.AbstractTexture

参照されるテクスチャが 1 次元配列、2 次元配列、3 次元、キューブマップ、キューブマップ配列、または 2 次元マルチサンプル配列テクスチャの場合、テクスチャレベル全体、またはテクスチャレベルの 1 つのレイヤーまたは面のいずれかをバインドできます。これは、layered プロパティで制御できます。

ShaderImageのサポートはOpenGL 4でのみサポートされており、OpenGL ES 3.1と3.2では部分的にサポートされています。

OpenGL 4では、以下のイメージタイプがサポートされています:

GLSLタイプOpenGLタイプ列挙型テクスチャ・タイプ
image1DGL_IMAGE_1DTexture1D
画像2DGL_IMAGE_2DTexture2D
画像3DGL_IMAGE_3DTexture3D
イメージ2DレクトGL_IMAGE_2DRECTTextureRectangle
イメージキューブGL_IMAGE_CUBETextureCubeMap
イメージバッファgl_image_buffer。TextureBuffer
image1DArraygl_image_1d_array。Texture1DArray
イメージ2Dアレイgl_image_2d_array。Texture2DArray
イメージキューブマップ配列gl_image_cube_map_array。TextureCubeMapArray
画像2DMSgl_image_2d_multisample。Texture2DMultisample
image2DMSArraygl_image_2d_multisample_arrayTexture2DMultisampleArray
iimage1Dgl_int_image_1dTexture1D
iimage2Dgl_int_image_2dTexture2D
iimage3Dgl_int_image_3dTexture3D
iimage2DRectgl_int_image_2d_rectTextureRectangle
画像キューブgl_int_image_cubeTextureCubeMap
iimageバッファgl_int_image_bufferTextureBuffer
iimage1DArraygl_int_image_1d_arrayTexture1DArray
iimage2DArraygl_int_image_2d_arrayTexture2DArray
iimageCubeArraygl_int_image_cube_map_arrayTextureCubeMapArray
iimage2DMSgl_int_image_2d_multisampleTexture2DMultisample
iimage2DMSArraygl_int_image_2d_multisample_arrayTexture2DMultisampleArray
uimage1Dgl_unsigned_int_image_1dTexture1D
uimage2Dgl_unsigned_int_image_2dTexture2D
uimage3Dgl_unsigned_int_image_3dTexture3D
uimage2DRectgl_unsigned_int_image_2d_rectTextureRectangle
uimageCubegl_unsigned_int_image_cubeTextureCubeMap
uimageBuffergl_unsigned_int_image_bufferTextureBuffer
uimage1DArraygl_unsigned_int_image_1d_arrayTexture1DArray
uimage2DArraygl_unsigned_int_image_2d_arrayTexture2DArray
uimageCubeArraygl_unsigned_int_image_cube_map_arrayTextureCubeMapArray
uimage2DMSgl_unsigned_int_image_2d_multisampleTexture2DMultisample
uimage2DMSArraygl_unsigned_int_image_2d_multisample_arrayTexture2DMultisampleArray

OpenGL ES 3.1は以下の画像タイプをサポートしています:

GLSLタイプOpenGLタイプ列挙型テクスチャタイプ
イメージ2DGL_IMAGE_2DTexture2D
画像3DGL_IMAGE_3DTexture3D
イメージキューブGL_IMAGE_CUBETextureCubeMap
画像2D配列GL_IMAGE_2DA_ARRAYTexture2DArray
iimage2Dgl_int_image_2dTexture2D
iimage3Dgl_int_image_3d。Texture3D
画像キューブgl_int_image_cubeTextureCubeMap
iimage2DArraygl_int_image_2d_arrayTexture2DArray
uimage2Dgl_unsigned_int_image_2dTexture2D
uimage3Dgl_unsigned_int_image_3dTexture3D
uimageCubegl_unsigned_int_image_cubeTextureCubeMap
uimage2DArraygl_unsigned_int_image_2d_arrayTexture2DArray

OpenGL ES 3.2は、OpenGL ES 3.1のすべての画像タイプに加え、以下をサポートしています:

GLSLタイプOpenGLタイプ列挙型テクスチャ・タイプ
イメージバッファgl_image_bufferTextureBuffer
イメージキューブマップ配列gl_image_cube_map_arrayTextureCubeMapArray
iimageバッファgl_image_bufferTextureBuffer
iimageCubeArraygl_int_image_cube_map_arrayTextureCubeMapArray
uimageBuffergl_unsigned_int_image_bufferTextureBuffer
uimageCubeArraygl_unsigned_int_image_cube_map_arrayTextureCubeMapArray

予想される使い方は次のようになる:

import Qt3D.Render 2.14

Entity {
...
    Texture2D {
        id: tex2D
        ...
    }

    Material {
        parameters: Parameter {
            name: "imageUniformName"
            value: ShaderImage {
                texture: tex2D
            }
        }
        ...
    }
 ...
}

プロパティの説明

access : enumeration

シェーダーインスタンスから画像へのアクセスタイプを指定します。シェーダが互換性のないアクセスを持つ画像から書き込みや読み込みを行おうとした場合、その動作は未定義です。

定数説明
ShaderImage.ReadOnly読み取り専用アクセス。
ShaderImage.WriteOnly書き込み専用アクセス。
ShaderImage.ReadWrite読み書きアクセス。

デフォルト値はShaderImage.ReadWrite。


format : enumeration

シェーダーからShaderImage に値を格納するときに本質的に重要な、画像フォーマットを指定します。

このフォーマットは、参照されるテクスチャのフォーマットと同じである必要はありません。しかし、互換性がなければなりません(サイズは一致しますが、クラスタイプは必ずしも一致しません)。たとえば、フォーマット R32F(サイズ 32 ビット、クラス 1x32)のテクスチャは、フォーマット RGBA8I(サイズ 32 ビット、クラス 4x8)の画像で使用できます。OpenGL仕様の表8.27に、サポートされているすべての画像フォーマットのサイズとクラスが示されています。

デフォルトでは、Qt3Dは参照されるテクスチャのフォーマットに合うように画像フォーマットを設定しようとします。

デフォルト値はShaderImage です。


layer : int

ShaderImageこのプロパティは、layered が true に設定されている場合、または参照テクスチャのタイプがレイヤーと互換性がない場合、何もしません。

Note: 参照テクスチャのタイプがキューブマップまたはキューブマップ配列で、ĺayered が false に設定されている場合、面とレイヤは以下の方法で取得されます:

cubeMapLayer = layer / 6
cubeMapFace = layer - (cubeMapLayer * 6)

デフォルト値は 0 です。


layered : bool

*

true に設定すると、参照されるテクスチャが 1 次元配列、2 次元配列、3 次元、キューブ マップ、キューブ マップ配列、または 2 次元マルチサンプル配列テクスチャの場合、すべてのレイヤに対してレベル全体がバインドされます。false に設定すると、layer プロパティで指定された単一のレイヤーのみがバインドされます。

デフォルト値はfalse です。


mipLevel : int

参照されるテクスチャのうち、どの mipLevel をShaderImage に使用するかを保持します。

デフォルト値は 0 です。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.