wjarosz,

#GPU / #GameDev folks, I need some advice:

I need to display 32-bit/channel floating point images. For various reasons (there are many channels, think multi-spectral images), it is more convenient for me to group the data on the CPU by channel planes.

Before doing multispectral, I was uploading 32-bit floating RGBA textures. Would it be a horrible idea (performance wise) to instead upload each channel as a single-channel 32-bit float texture (GL_RED/MTLPixelFormatR32Float) and then sample from whichever channel textures I want and reassemble to visualize color within my fragment shader?

I figured that for 8-bit/channel images there would be a big benefit to uploading/storing as RGBA (vs. 4 separate single-channel textures) since it’s 32 bits per pixel total; but with each floating point channel already being 32 bpp, perhaps this isn’t as much a concern in my case?

In case it matters, my target platforms as #OpenGL, #WebGL, and #Metal.

Thanks!

aras,
@aras@mastodon.gamedev.place avatar

@wjarosz should be fine

aras,
@aras@mastodon.gamedev.place avatar

@wjarosz fun fact: that’s what some of the GPUs do behind the scenes for “RGB” (without A) formats. Internally split into multiple single channel textures, sample and combine in the shader. Others generally just go “nope, we just can’t RGB without A”

  • All
  • Subscribed
  • Moderated
  • Favorites
  • GraphicsProgramming
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines