Skip to content
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

internal/shader: support for integer vectors (ivec2, ivec3, and ivec4) #1911

Closed
Zyko0 opened this issue Dec 24, 2021 · 5 comments
Closed

internal/shader: support for integer vectors (ivec2, ivec3, and ivec4) #1911

Zyko0 opened this issue Dec 24, 2021 · 5 comments

Comments

@Zyko0
Copy link
Contributor

Zyko0 commented Dec 24, 2021

I was wondering if it was possible to provide support for more vector types since scalar types are already handled by Kage ?

I know glsl supports a vector type for each of them:

Each of the scalar types, including booleans, have 2, 3, and 4-component vector equivalents. The n digit below can be 2, 3, or 4:

  • bvecn: a vector of booleans
  • ivecn: a vector of signed integers
  • uvecn: a vector of unsigned integers
  • vecn: a vector of single-precision floating-point numbers
  • dvecn: a vector of double-precision floating-point numbers

Vector values can have the same math operators applied to them that scalar values do. These all perform the component-wise operations on each component. However, in order for these operators to work on vectors, the two vectors must have the same number of components.

@hajimehoshi
Copy link
Owner

hajimehoshi commented Dec 24, 2021

Sure, I haven't determine the priority yet but I can do.

@hajimehoshi
Copy link
Owner

This requires a lot of work. Let me defer this to v2.4.0.

@hajimehoshi hajimehoshi modified the milestones: v2.3.0, v2.4.0 Apr 1, 2022
@hajimehoshi hajimehoshi modified the milestones: v2.4.0, v2.5.0 Aug 7, 2022
@hajimehoshi hajimehoshi changed the title Kage: support for integer vectors internal/shader: support for integer vectors (ivec2, ivec3, and ivec4) Nov 18, 2022
@hajimehoshi
Copy link
Owner

I'm working on ivec. bvec would be another issue. I don't support uvec or dvec as WebGL doesn't.

@hajimehoshi
Copy link
Owner

https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf

vec3(float) // initializes each component of the vec3 with the float
vec4(ivec4) // makes a vec4 with component-wise conversion
vec4(mat2) // the vec4 is column 0 followed by column 1

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 20, 2022

Some very basic tests didn't pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants