Add an use_hdr property to GradientTexture to allow storing HDR colors

This is disabled by default to save some memory and preserve the existing
behavior of clamping colors.
This commit is contained in:
Hugo Locurcio
2021-05-02 03:53:10 +02:00
parent 761eb7e06a
commit 1d257d02db
3 changed files with 62 additions and 18 deletions

View File

@ -686,6 +686,7 @@ private:
bool update_pending = false;
RID texture;
int width = 2048;
bool use_hdr = false;
void _queue_update();
void _update();
@ -700,6 +701,9 @@ public:
void set_width(int p_width);
int get_width() const override;
void set_use_hdr(bool p_enabled);
bool is_using_hdr() const;
virtual RID get_rid() const override { return texture; }
virtual int get_height() const override { return 1; }
virtual bool has_alpha() const override { return true; }