日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

HLSL Texture Object Sample 的一些笔记

發布時間:2025/7/25 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HLSL Texture Object Sample 的一些笔记 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Practical Rendering And Computation With D3D11 書上的解釋

"The Sample method allows for hardware texture filtering (minification, magnification,
and mip-map interpolation) to be performed, according to a given sampler state." p340

?"When Sample is called on a texture that contains multiple mip-map levels, the mipmap
level is automatically selected based on the screen-space derivatives (also known
as gradients) of the texture coordinates." p341

總結

SampleLevel比Sample運算簡單,因為它指定了mipmap-level, 不會執行texture mipmap之間的插值計算。

Texture.Sample, Offset參數的解釋

https://www.gamedev.net/forums/topic/496105-directx-10-sampling-surounding-texels-in-pixel-shader-solved/

Hi there... I was wondering what the correct way is to sample surounding texels in a pixel shader?
I assume I should make a sampler state that does point sampling, then use something along these lines to read the surounding texels to implement my own interpolation:

extern Texture2D dataTexture;
SamplerState TextureSampler
{
?? ?Filter = MIN_MAG_MIP_POINT;
?? ?AddressU = Clamp; AddressV = Clamp;
};

float2 texelSize = float2(TexelWidth, TexelHeight);

float t0 = dataTexture.Sample(TextureSampler, input.texCoord + float2(-1, -1) * texelSize);
float t1 = dataTexture.Sample(TextureSampler, input.texCoord + float2(-1, 0) * texelSize);
float t2 = dataTexture.Sample(TextureSampler, input.texCoord + float2( 0, 0) * texelSize);
float t3 = dataTexture.Sample(TextureSampler, input.texCoord + float2( 0, -1) * texelSize);

Anyone know a better way to do this???
The reason why I have to write my own interpolation in the shader is because some of the values should not be interpolated between...
for the textures where I only have one value range, I am using the MIN_MAG_MIP_LINEAR sampler state and then do a single Sample command.

[Edited by - GoodFun on June 2, 2008 9:40:55 AM]

---------------------------------------------------
Yes, the way you're doing it is correct.

It's common to do this sort of thing when you're using a texture to store look-up values.
One thing to keep in mind is that you will probably want to offset your texture fetches by
half a pixel so that you sample in the center of the pixel instead of on the exact border.
That way you can be sure you're fetching the value you expect.

neneboricua

---------------------------------------------------
Actually, this isn't required for DirectX10. In DX10, pixel offsets refer to the centre of the pixel,
not the top-left (which was the case in DX9 and earlier).

OP: Yes, there is an easier way to do it. DX10's texture sampling functions support direct integer
texel offsets. So for example, you can just do this:


dataTexture.Sample(TextureSampler, input.texCoord, int2(-1, 0));

This will sample the texel to the immediate left of the one at input.texCoord.
This means that you don't need to manually generate and apply an offset directly to the texture coordinate,
and can use integer offsets directly.

Sc4Freak

總結

Offset 可以認為是偏移指定的紋理坐標單位。(1.0 / texels_width, 1.0 / texels_height).

?

轉載于:https://www.cnblogs.com/hzzhouqq/p/8866519.html

總結

以上是生活随笔為你收集整理的HLSL Texture Object Sample 的一些笔记的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产色网站 | 色偷偷噜噜噜亚洲男人 | 成年人免费网 | 91日韩中文字幕 | 欧美一区二区三区小说 | 男女爱爱动态图 | 日日夜夜综合 | 色婷婷国产 | 自拍偷拍小视频 | 国产精品影音先锋 | 成人男女视频 | av收藏小四郎最新地址 | 日韩二区三区四区 | 伊人开心网 | www.黄色一片 | 午夜蜜桃视频 | 亚洲爱情岛论坛永久 | 最新国产毛片 | 日本人妻换人妻毛片 | 亚洲男人的天堂在线视频 | 国产成人福利 | 黄色片不卡 | 99热91| 中文字幕av日韩 | 国产一区久久久 | 看黄色的网址 | 91网在线| 手机看片国产1024 | 国内一级黄色片 | 国产日韩欧美视频在线 | 3344av| 中文字幕乱码人妻无码久久 | 日韩一区二区三区av | 变态另类丨国产精品 | 欧美精品aa | 午夜tv影院| 午夜寂寞影院在线观看 | 午夜成人免费视频 | 一二三av| 国产美女裸体无遮挡免费视频 | www.久久99| 精品乱人伦一区二区三区 | 伊人自拍| 怡红院综合网 | 亚洲自拍偷拍在线 | 香蕉视频99 | 日韩av在线播放网址 | 久久久久久蜜桃一区二区 | 亚洲色婷婷久久精品av蜜桃 | 国际av在线 | 色一色成人网 | 久久久国产精品免费 | 精品久久久久亚洲 | 日韩在线观看免费高清 | 国产日韩视频在线 | 哺乳喂奶一二三区乳 | 在线播放无码后入内射少妇 | 99国产精品99 | 亚洲欧美自偷自拍 | 国内成人免费视频 | 五月天丁香社区 | 亚洲一区二区成人 | 成人在线免费高清视频 | 天天干天天操天天玩 | 亚洲久久久 | 国产片久久 | 欧美做受视频 | 清冷学长被爆c躁到高潮失禁 | 亚洲精品无 | 亚洲成人毛片 | 国产又粗又大又爽视频 | 二区久久 | 九九av在线 | 黄色私人影院 | 欧美黄在线观看 | 亚洲精品综合 | 中文字幕无码毛片免费看 | 黄色国产在线播放 | 日韩欧美aⅴ综合网站发布 国产成人一区二区三区小说 | 91视频www| 国产三级做爰高清在线 | 亚洲色偷偷综合亚洲av伊人 | 91久久精品夜夜躁日日躁欧美 | 亚洲综合在线中文字幕 | 日韩在线不卡视频 | 成人av影院 | 日韩精品成人 | 午夜精品毛片 | 亚洲天堂精品视频 | 久热国产精品视频 | 中文字幕欧美亚洲 | 尹人综合| 国产日韩欧美一二三区 | 欧美日韩一级视频 | 中文综合网 | 天天干天天碰 | 国产淫片 | 99视频一区 | 国模无码一区二区三区 |