enzoDs Posted July 18, 2021 Share Posted July 18, 2021 VS.Position = float3(1, 2, 3); how i can "unpack" VS.Position? I need make this: (but in .fx language) VsPosition = {1,2,3} x, y, z = unpack( VsPosition ) Link to comment
DiSaMe Posted July 18, 2021 Share Posted July 18, 2021 I'm not familiar with HLSL syntax (never did any programming in HLSL), but based on https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math#the-vector-type, it should look something like this: float x = VS.Position.x; float y = VS.Position.y; float z = VS.Position.z; If it's unpacking syntax that you want (assigning to multiple variables from a single vector at once), I don't think HLSL has it, but you could write a function with one in vector argument and three out scalar arguments for each component. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now