Questions tagged [float]

7 questions
5
votes
1 answer

Precision problem on AMD

I have a problem with precision on AMD in shaders (hlsl). In vertex shader I calculate UVs for particle using modulus operator on float. With simple % there is a problem on Nvidia and on AMD (e.g. 7 % 7 = 7) so I have written modulus as: float Mod(…
Derag
  • 596
  • 2
  • 11
2
votes
1 answer

Floating Point Operations in Line Drawing Algorithms

When it comes to line drawing, DDA is the simplest and most intuitive algorithm, the core idea being: compute the slope of the line for every increment in x, increment y by the slope However, DDA is not favored due to its use of floating point…
wsaleem
  • 121
  • 2
2
votes
1 answer

How to work with half and snorm

I have just come across this article about half, snorm and unorm, but I don't get some of the points (or why they work). According to the article, a half is basically a 16 bit float and an snorm is a signed float integer$^1$ dividied by 65535.…
Tare
  • 1,477
  • 5
  • 22
1
vote
1 answer

How do (Direct3D) precision conversions for floats work?

There is this article about conversions in Direct3D: https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-data-conversion I do not understand the part of conversion from higher to lower…
Tare
  • 1,477
  • 5
  • 22
0
votes
0 answers

Loop subdivision, certain areas converging towards degenerate geometry

I coded loop subdivision and ran it on a cube with triangle faces. I noticed this: I am using doubles to represent my vertex positions, I am not 100% sure these are caused by floating point imprecisions, but since the general shape looks ok I am…
Makogan
  • 1,584
  • 8
  • 27
0
votes
1 answer

Splitting Floats To Texture Channels

I know, this is a silly question, but since I need this so often, I just want to double check that I made no mistake. Working with most shader languages, a texture can store $8$ bits per channels, which in the shader programm appear as value in the…
fweth
  • 127
  • 4
0
votes
1 answer

Plot inverse of emulated double-precision floats

I need to accurately plot a line chart using WebGL. The numbers have a precision of around 33 bits - that's too many to fit into a single-precision float's mantissa. WebGL does not support the double-precision floats that arrive in my program so I…