简体   繁体   English

OpenTK 4:这是如何设置各向异性过滤?

[英]OpenTK 4: Is this how to set anisotropic filtering?

In migrating to OpenTK4, I don't know if this is the correct way to set my value for anisotropic filtering.在迁移到 OpenTK4 时,我不知道这是否是设置各向异性过滤value的正确方法。

Is it:是吗:

float value = 1.0f;  // Dummy value for example

GL.TexParameter(target, (TextureParameterName)0x84FE, value);

Is there an enum defined somewhere I can cast in its place?是否在某个地方定义了一个枚举,我可以在它的位置进行转换? Instead of a hex code, that is.不是十六进制代码,而是。

Anisotropic filtering is part of the OpenGL 4.6 standard.各向异性过滤是 OpenGL 4.6 标准的一部分。 See OpenGL 4.6 API Core Profile Specification - 8.10 Texture Parameters .请参阅OpenGL 4.6 API 核心配置文件规范 - 8.10 纹理参数
However, the texture parameter TEXTURE_MAX_ANISOTROPY_ (0x84FE, 34046) is missing in enum TextureParameterName ( namespace OpenTK.Graphics.OpenGL4 ).但是, enum TextureParameterNamenamespace OpenTK.Graphics.OpenGL4 )中缺少纹理参数 TEXTURE_MAX_ANISOTROPY_ (0x84FE, 34046)。
In addition the parameter MAX_TEXTURE_MAX_ANISOTROPY (0x84FF, 34047) is missing in enum GetPName .此外, enum GetPName中缺少参数 MAX_TEXTURE_MAX_ANISOTROPY (0x84FF, 34047)。


I have created an issue in the OpenTK GitHub repository:我在 OpenTK GitHub 存储库中创建了一个问题:
Texture parameter TEXTURE_MAX_ANISOTROPY is missing #1270缺少纹理参数 TEXTURE_MAX_ANISOTROPY #1270

The issue will be fixed in OpenTK 5. One workaround is to use enum All and cast it to the correct type:该问题将在 OpenTK 5 中得到解决。一种解决方法是使用enum All并将其转换为正确的类型:

float maxTextureMaxAnisotropy = GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy);
GL.TexParameter(target, (TextureParameterName)All.TextureMaxAnisotropy, maxTextureMaxAnisotropy);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM