# How could I blending a float type buffer texture(hdr texture) using 8-bit textures(jpg/png)

**URL:** <https://discourse.threejs.org/t/how-could-i-blending-a-float-type-buffer-texture-hdr-texture-using-8-bit-textures-jpg-png/11030>\
**Category:** Questions\
**Tags:** textures\
**Created:** [November 25, 2019, 9:59am UTC](https://discourse.threejs.org/t/how-could-i-blending-a-float-type-buffer-texture-hdr-texture-using-8-bit-textures-jpg-png/11030 "2019-11-25T09:59:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![towrabbit](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/towrabbit/32/6955_2.png) [@towrabbit](https://discourse.threejs.org/u/towrabbit)\
**Post date:** [November 25, 2019, 9:59am UTC](https://discourse.threejs.org/t/how-could-i-blending-a-float-type-buffer-texture-hdr-texture-using-8-bit-textures-jpg-png/11030/1 "2019-11-25T09:59:53Z")

</div>

hello there, I’m trying to render a scene using lightMap without any light source. but there are some problem I have to solve.

I use hdr files as input texture and a single 32-bit texture as output for lightMap. it works fine in modern devices which support ‘EXT\_float\_blend’ extension.

I find out that there are many devices support ‘color\_buffer\_float’ but not support ‘EXT\_float\_blend’.In other words. those devices support 8-bit texture as input and 32-bit(float buffer) as output but not support for 32-bit textures as input and 32-bit texture as output.

so is there some way that I can change hdr file to 4 or maybe more 8-bit textures(png or jpg) but those pictures can store the all the data that hdr file has. and then using these 8-bit textures to rebuild a same 32-bit float buffer texture as hdr did?

here is difference between hdr blending (32-bit texture, left) and jpg blending(8-bit texture, right)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/b/b2bd8f16b6743baeba4573c3c79219693072a597.jpeg)

[live demo jpg vs hdr](https://codepen.io/towrabbit/pen/oNNRqVx)

here is difference between use hdr as input but different output type(left Unsigned byte type, right Float type)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/a/a189fee8ea89159c4e6c4671292e57afa8b9f102.jpeg)

[live demo different type](https://codepen.io/towrabbit/pen/QWWRQdy)

here is what it look like in my project but till now it not work on devices which don’t support ‘EXT\_float\_blend’

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/a/ab27c67e567918374334b440b7bcddfa40854f67.jpeg)

solved by myself 11-29 2019

---

<div class="post-metadata">

**Author:** ![towrabbit](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/towrabbit/32/6955_2.png) [@towrabbit](https://discourse.threejs.org/u/towrabbit)\
**Post date:** [December 2, 2019, 3:20am UTC](https://discourse.threejs.org/t/how-could-i-blending-a-float-type-buffer-texture-hdr-texture-using-8-bit-textures-jpg-png/11030/2 "2019-12-02T03:20:31Z")

</div>

solution, first change hdr file to 4 8-bit textures and save as single png file, 8-bit data for each texture and together there are 32-bit. then rebuid a 8-bit texture using texture mapping using exposure(intensity) and/or temperature as uniforms.

 ![%E9%87%8D%E7%BB%98](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/a/a5299c873e175d2591977ba68b0f2b7ca8dd7792.png)  
left bottom from 1 to 8 bit, left top from 9 to 16 bit, right top from 17 to 24bit, right bottom from 25 to 32 bit.  
right texture : rebuilded texture
