-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add wrapR property to Sampler and Texture3D #12701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
446ccb2
909de55
78dd3c8
6a768f1
a3e5079
7601be3
eb0e586
b4bfd3e
a62e93b
b7283cd
1835d14
b04a0cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,21 +13,30 @@ import Sampler from "./Sampler.js"; | |
| import TextureMagnificationFilter from "./TextureMagnificationFilter.js"; | ||
| import TextureMinificationFilter from "./TextureMinificationFilter.js"; | ||
|
|
||
| /** | ||
| * @typedef {object} Texture3D.Source | ||
Hiwen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * @property {number} width The width (in pixels) of the 3D texture source data. | ||
| * @property {number} height The height (in pixels) of the 3D texture source data. | ||
| * @property {number} depth The depth (in pixels) of the 3D texture source data. | ||
| * @property {TypedArray|DataView} arrayBufferView The source data for a 3D texture. The type of each element needs to match the pixelDatatype. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs for texImage3D and texSubImage3D allow for these additional sources:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using ImageBitmap, ImageData, HTMLImageElement, HTMLCanvasElement, and HTMLVideoElement as the source is a really good idea. However, I haven't actually used this yet, and I'm not sure about the specific effects. I think it would be better to open a new issue to support this. |
||
| * @property {TypedArray|DataView} [mipLevels] An array of mip level data. Each element in the array should be a TypedArray or DataView that matches the pixelDatatype. | ||
| */ | ||
|
|
||
| /** | ||
| * @typedef {object} Texture3D.ConstructorOptions | ||
| * | ||
| * @property {Context} context | ||
| * @property {object} [source] The source for texel values to be loaded into the texture3D. | ||
| * @property {Texture3D.Source} [source] The source for texel values to be loaded into the 3D texture. | ||
| * @property {PixelFormat} [pixelFormat=PixelFormat.RGBA] The format of each pixel, i.e., the number of components it has and what they represent. | ||
| * @property {PixelDatatype} [pixelDatatype=PixelDatatype.UNSIGNED_BYTE] The data type of each pixel. | ||
| * @property {boolean} [flipY=true] If true, the source values will be read as if the y-axis is inverted (y=0 at the top). | ||
| * @property {boolean} [skipColorSpaceConversion=false] If true, color space conversions will be skipped when reading the texel values. | ||
| * @property {Sampler} [sampler] Information about how to sample the texture3D. | ||
| * @property {number} [width] The pixel width of the texture3D. If not supplied, must be available from the source. | ||
| * @property {number} [height] The pixel height of the texture3D. If not supplied, must be available from the source. | ||
| * @property {number} [depth] The pixel depth of the texture3D. If not supplied, must be available from the source. | ||
| * @property {Sampler} [sampler] Information about how to sample the 3D texture. | ||
| * @property {number} [width] The width (in pixels) of the 3D texture. If not supplied, must be available from the source. | ||
| * @property {number} [height] The height (in pixels) of the 3D texture. If not supplied, must be available from the source. | ||
| * @property {number} [depth] The depth (in pixels) of the 3D texture. If not supplied, must be available from the source. | ||
| * @property {boolean} [preMultiplyAlpha] If true, the alpha channel will be multiplied into the other channels. | ||
| * @property {string} [id] A unique identifier for the texture3D. If this is not given, then a GUID will be created. | ||
| * @property {string} [id] A unique identifier for the 3D texture. If this is not given, then a GUID will be created. | ||
| * | ||
| * @private | ||
| */ | ||
|
|
@@ -253,7 +262,7 @@ function Texture3D(options) { | |
| * Load texel data from a buffer into a texture3D. | ||
| * | ||
| * @param {Texture3D} texture3D The texture3D to which texel values will be loaded. | ||
| * @param {object} source The source for texel values to be loaded into the texture3D. | ||
| * @param {Texture3D.Source} source The source for texel values to be loaded into the texture3D. | ||
| * | ||
| * @private | ||
| */ | ||
|
|
@@ -503,6 +512,7 @@ function setupSampler(texture3D, sampler) { | |
| gl.bindTexture(target, texture3D._texture); | ||
| gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter); | ||
| gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter); | ||
| gl.texParameteri(target, gl.TEXTURE_WRAP_R, sampler.wrapR); | ||
| gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS); | ||
| gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT); | ||
| if (defined(texture3D._textureFilterAnisotropic)) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.