summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/file_dialog.cpp14
-rw-r--r--scene/gui/file_dialog.h3
-rw-r--r--scene/gui/item_list.cpp56
-rw-r--r--scene/gui/item_list.h7
-rw-r--r--scene/gui/line_edit.cpp5
-rw-r--r--scene/gui/text_edit.cpp163
-rw-r--r--scene/gui/text_edit.h3
-rw-r--r--scene/resources/baked_light.cpp46
-rw-r--r--scene/resources/baked_light.h9
-rw-r--r--scene/resources/shader_graph.cpp18
10 files changed, 218 insertions, 106 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index b8b8c99c39..64fdfdfefe 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -181,12 +181,10 @@ void FileDialog::_action_pressed() {
String f=dir_access->get_current_dir().plus_file(file->get_text());
- if (mode==MODE_OPEN_FILE && dir_access->file_exists(f)) {
+ if ((mode==MODE_OPEN_ANY || mode==MODE_OPEN_FILE) && dir_access->file_exists(f)) {
emit_signal("file_selected",f);
hide();
- }
-
- if (mode==MODE_OPEN_DIR) {
+ }else if (mode==MODE_OPEN_ANY || mode==MODE_OPEN_DIR) {
String path=dir_access->get_current_dir();
@@ -304,7 +302,7 @@ void FileDialog::_tree_dc_selected() {
if (d["dir"]) {
dir_access->change_dir(d["name"]);
- if (mode==MODE_OPEN_FILE || mode==MODE_OPEN_FILES || mode==MODE_OPEN_DIR)
+ if (mode==MODE_OPEN_FILE || mode==MODE_OPEN_FILES || mode==MODE_OPEN_DIR || mode==MODE_OPEN_ANY)
file->set_text("");
call_deferred("_update_file_list");
call_deferred("_update_dir");
@@ -552,8 +550,9 @@ void FileDialog::set_mode(Mode p_mode) {
case MODE_OPEN_FILE: get_ok()->set_text("Open"); set_title("Open a File"); makedir->hide(); break;
case MODE_OPEN_FILES: get_ok()->set_text("Open"); set_title("Open File(s)"); makedir->hide(); break;
- case MODE_SAVE_FILE: get_ok()->set_text("Save"); set_title("Save a File"); makedir->show(); break;
case MODE_OPEN_DIR: get_ok()->set_text("Open"); set_title("Open a Directory"); makedir->show(); break;
+ case MODE_OPEN_ANY: get_ok()->set_text("Open"); set_title("Open a File or Directory"); makedir->show(); break;
+ case MODE_SAVE_FILE: get_ok()->set_text("Save"); set_title("Save a File"); makedir->show(); break;
}
if (mode==MODE_OPEN_FILES) {
@@ -710,6 +709,8 @@ void FileDialog::_bind_methods() {
BIND_CONSTANT( MODE_OPEN_FILE );
BIND_CONSTANT( MODE_OPEN_FILES );
BIND_CONSTANT( MODE_OPEN_DIR );
+ BIND_CONSTANT( MODE_OPEN_ANY );
+
BIND_CONSTANT( MODE_SAVE_FILE );
BIND_CONSTANT( ACCESS_RESOURCES );
@@ -877,3 +878,4 @@ LineEditFileChooser::LineEditFileChooser() {
dialog->connect("files_selected",this,"_chosen");
}
+
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index 2042adbc20..1fcf8387ce 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -57,7 +57,8 @@ public:
MODE_OPEN_FILE,
MODE_OPEN_FILES,
MODE_OPEN_DIR,
- MODE_SAVE_FILE,
+ MODE_OPEN_ANY,
+ MODE_SAVE_FILE
};
typedef Ref<Texture> (*GetIconFunc)(const String&);
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 2d2cabfc01..171dd94bfa 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -7,6 +7,7 @@ void ItemList::add_item(const String& p_item,const Ref<Texture>& p_texture,bool
Item item;
item.icon=p_texture;
+ item.icon_region=Rect2i();
item.text=p_item;
item.selectable=p_selectable;
item.selected=false;
@@ -23,6 +24,7 @@ void ItemList::add_icon_item(const Ref<Texture>& p_item,bool p_selectable){
Item item;
item.icon=p_item;
+ item.icon_region=Rect2i();
//item.text=p_item;
item.selectable=p_selectable;
item.selected=false;
@@ -79,6 +81,7 @@ void ItemList::set_item_icon(int p_idx,const Ref<Texture>& p_icon){
}
+
Ref<Texture> ItemList::get_item_icon(int p_idx) const{
ERR_FAIL_INDEX_V(p_idx,items.size(),Ref<Texture>());
@@ -87,6 +90,22 @@ Ref<Texture> ItemList::get_item_icon(int p_idx) const{
}
+void ItemList::set_item_icon_region(int p_idx,const Rect2& p_region) {
+
+ ERR_FAIL_INDEX(p_idx,items.size());
+
+ items[p_idx].icon_region=p_region;
+ update();
+ shape_changed=true;
+}
+
+Rect2 ItemList::get_item_icon_region(int p_idx) const {
+
+ ERR_FAIL_INDEX_V(p_idx,items.size(),Rect2());
+
+ return items[p_idx].icon_region;
+}
+
void ItemList::set_item_custom_bg_color(int p_idx,const Color& p_custom_bg_color) {
ERR_FAIL_INDEX(p_idx,items.size());
@@ -362,7 +381,15 @@ Size2 ItemList::get_min_icon_size() const {
return min_icon_size;
}
+Size2 ItemList::Item::get_icon_size() const {
+ if (icon.is_null())
+ return Size2();
+ if (icon_region.has_no_area())
+ return icon->get_size();
+
+ return icon_region.size;
+}
void ItemList::_input_event(const InputEvent& p_event) {
if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT && p_event.mouse_button.pressed) {
@@ -702,7 +729,9 @@ void ItemList::_notification(int p_what) {
Size2 minsize;
if (items[i].icon.is_valid()) {
- minsize=items[i].icon->get_size();
+
+ minsize=items[i].get_icon_size();
+
if (min_icon_size.x!=0)
minsize.x = MAX(minsize.x,min_icon_size.x);
if (min_icon_size.y!=0)
@@ -851,18 +880,30 @@ void ItemList::_notification(int p_what) {
Vector2 text_ofs;
if (items[i].icon.is_valid()) {
+ Size2 icon_size = items[i].get_icon_size();
+
Vector2 icon_ofs;
if (min_icon_size!=Vector2()) {
- icon_ofs = (min_icon_size - items[i].icon->get_size())/2;
+ icon_ofs = (min_icon_size - icon_size)/2;
}
+ Point2 pos = items[i].rect_cache.pos + icon_ofs + base_ofs;
+
if (icon_mode==ICON_MODE_TOP) {
- draw_texture(items[i].icon,icon_ofs+items[i].rect_cache.pos+Vector2(items[i].rect_cache.size.width/2-items[i].icon->get_width()/2,0).floor()+base_ofs);
- text_ofs.y = MAX(items[i].icon->get_height(),min_icon_size.y)+icon_margin;
+
+ pos.x += Math::floor((items[i].rect_cache.size.width - icon_size.width)/2);
+ text_ofs.y = MAX(icon_size.height, min_icon_size.y) + icon_margin;
} else {
- draw_texture(items[i].icon,icon_ofs+items[i].rect_cache.pos+Vector2(0,items[i].rect_cache.size.height/2-items[i].icon->get_height()/2).floor()+base_ofs);
- text_ofs.x = MAX(items[i].icon->get_width(),min_icon_size.x)+icon_margin;
+
+ pos.y += Math::floor((items[i].rect_cache.size.height - icon_size.height)/2);
+ text_ofs.x = MAX(icon_size.width, min_icon_size.x) + icon_margin;
}
+
+ if (items[i].icon_region.has_no_area())
+ draw_texture(items[i].icon, pos);
+ else
+ draw_texture_rect_region(items[i].icon, Rect2(pos, icon_size), items[i].icon_region);
+
}
if (items[i].tag_icon.is_valid()) {
@@ -1061,6 +1102,9 @@ void ItemList::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon:Texture"),&ItemList::set_item_icon);
ObjectTypeDB::bind_method(_MD("get_item_icon:Texture","idx"),&ItemList::get_item_icon);
+ ObjectTypeDB::bind_method(_MD("set_item_icon_region","idx","rect"),&ItemList::set_item_icon_region);
+ ObjectTypeDB::bind_method(_MD("get_item_icon_region","idx"),&ItemList::get_item_icon_region);
+
ObjectTypeDB::bind_method(_MD("set_item_selectable","idx","selectable"),&ItemList::set_item_selectable);
ObjectTypeDB::bind_method(_MD("is_item_selectable","idx"),&ItemList::is_item_selectable);
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index bd3cf6484e..c9c575fd54 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -22,6 +22,7 @@ private:
struct Item {
Ref<Texture> icon;
+ Rect2i icon_region;
Ref<Texture> tag_icon;
String text;
bool selectable;
@@ -31,9 +32,10 @@ private:
String tooltip;
Color custom_bg;
-
Rect2 rect_cache;
+ Size2 get_icon_size() const;
+
bool operator<(const Item& p_another) const { return text<p_another.text; }
};
@@ -76,6 +78,9 @@ public:
void set_item_icon(int p_idx,const Ref<Texture>& p_icon);
Ref<Texture> get_item_icon(int p_idx) const;
+ void set_item_icon_region(int p_idx,const Rect2& p_region);
+ Rect2 get_item_icon_region(int p_idx) const;
+
void set_item_selectable(int p_idx,bool p_selectable);
bool is_item_selectable(int p_idx) const;
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 3953ef06a5..21dee62b38 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -274,6 +274,11 @@ void LineEdit::_input_event(InputEvent p_event) {
} break;
case KEY_DELETE: {
+ if (k.mod.shift && !k.mod.command && !k.mod.alt && editable) {
+ cut_text();
+ break;
+ }
+
if (editable) {
undo_text = text;
if (selection.enabled)
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 32f4be5d17..b80597560d 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1957,6 +1957,12 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (readonly)
break;
+
+ if (k.mod.shift && !k.mod.command && !k.mod.alt) {
+ cut();
+ break;
+ }
+
int curline_len = text[cursor.line].length();
if (cursor.line==text.size()-1 && cursor.column==curline_len)
@@ -2169,35 +2175,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
break;
}
- if (!selection.active){
-
- String clipboard = text[cursor.line];
- OS::get_singleton()->set_clipboard(clipboard);
- cursor_set_line(cursor.line);
- cursor_set_column(0);
- _remove_text(cursor.line,0,cursor.line,text[cursor.line].length());
-
- backspace_at_cursor();
- update();
- cursor_set_line(cursor.line+1);
- cut_copy_line = true;
-
- }
- else
- {
-
- String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- OS::get_singleton()->set_clipboard(clipboard);
-
- cursor_set_line(selection.from_line);
- cursor_set_column(selection.from_column);
-
- _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- selection.active=false;
- selection.selecting_mode=Selection::MODE_NONE;
- update();
- cut_copy_line = false;
- }
+ cut();
} break;
case KEY_C: {
@@ -2207,16 +2185,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
break;
}
- if (!selection.active){
- String clipboard = _base_get_text(cursor.line,0,cursor.line,text[cursor.line].length());
- OS::get_singleton()->set_clipboard(clipboard);
- cut_copy_line = true;
- }
- else{
- String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- OS::get_singleton()->set_clipboard(clipboard);
- cut_copy_line = false;
- }
+ copy();
+
} break;
case KEY_Z: {
@@ -2237,25 +2207,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
break;
}
- String clipboard = OS::get_singleton()->get_clipboard();
-
- if (selection.active) {
- selection.active=false;
- _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- cursor_set_line(selection.from_line);
- cursor_set_column(selection.from_column);
-
- }
- else if (cut_copy_line)
- {
- cursor_set_column(0);
- String ins="\n";
- clipboard += ins;
- }
-
- _insert_text_at_cursor(clipboard);
+ paste();
- update();
} break;
case KEY_SPACE: {
#ifdef OSX_ENABLED
@@ -2515,6 +2468,7 @@ void TextEdit::_insert_text(int p_line, int p_char,const String& p_text,int *r_e
//see if it shold just be set as current op
if (current_op.type!=op.type) {
+ op.prev_version = get_version();
_push_current_op();
current_op=op;
@@ -2522,6 +2476,7 @@ void TextEdit::_insert_text(int p_line, int p_char,const String& p_text,int *r_e
}
//see if it can be merged
if (current_op.to_line!=p_line || current_op.to_column!=p_char) {
+ op.prev_version = get_version();
_push_current_op();
current_op=op;
return; //set as current op, return
@@ -2565,6 +2520,7 @@ void TextEdit::_remove_text(int p_from_line, int p_from_column,int p_to_line,int
//see if it shold just be set as current op
if (current_op.type!=op.type) {
+ op.prev_version = get_version();
_push_current_op();
current_op=op;
return; //set as current op, return
@@ -2585,6 +2541,7 @@ void TextEdit::_remove_text(int p_from_line, int p_from_column,int p_to_line,int
//return; //update current op
}
+ op.prev_version = get_version();
_push_current_op();
current_op=op;
@@ -3024,20 +2981,33 @@ void TextEdit::set_auto_indent(bool p_auto_indent) {
void TextEdit::cut() {
- if (!selection.active)
- return;
+ if (!selection.active) {
+
+ String clipboard = text[cursor.line];
+ OS::get_singleton()->set_clipboard(clipboard);
+ cursor_set_line(cursor.line);
+ cursor_set_column(0);
+ _remove_text(cursor.line,0,cursor.line,text[cursor.line].length());
- String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- OS::get_singleton()->set_clipboard(clipboard);
+ backspace_at_cursor();
+ update();
+ cursor_set_line(cursor.line+1);
+ cut_copy_line = true;
- cursor_set_line(selection.from_line);
- cursor_set_column(selection.from_column);
+ } else {
- _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- selection.active=false;
- selection.selecting_mode=Selection::MODE_NONE;
- update();
+ String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
+ OS::get_singleton()->set_clipboard(clipboard);
+ cursor_set_line(selection.from_line);
+ cursor_set_column(selection.from_column);
+
+ _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
+ selection.active=false;
+ selection.selecting_mode=Selection::MODE_NONE;
+ update();
+ cut_copy_line = false;
+ }
}
void TextEdit::copy() {
@@ -3045,32 +3015,38 @@ void TextEdit::copy() {
if (!selection.active)
return;
- print_line("from line: "+itos(selection.from_line));
- print_line("from column: "+itos(selection.from_column));
- print_line("to line: "+itos(selection.to_line));
- print_line("to column: "+itos(selection.to_column));
-
- String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- OS::get_singleton()->set_clipboard(clipboard);
-
+ if (!selection.active) {
+ String clipboard = _base_get_text(cursor.line,0,cursor.line,text[cursor.line].length());
+ OS::get_singleton()->set_clipboard(clipboard);
+ cut_copy_line = true;
+ } else {
+ String clipboard = _base_get_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
+ OS::get_singleton()->set_clipboard(clipboard);
+ cut_copy_line = false;
+ }
}
+
void TextEdit::paste() {
+ String clipboard = OS::get_singleton()->get_clipboard();
+
if (selection.active) {
+ selection.active=false;
+ selection.selecting_mode=Selection::MODE_NONE;
+ _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
cursor_set_line(selection.from_line);
cursor_set_column(selection.from_column);
- _remove_text(selection.from_line,selection.from_column,selection.to_line,selection.to_column);
- selection.active=false;
- selection.selecting_mode=Selection::MODE_NONE;
+ } else if (cut_copy_line) {
+ cursor_set_column(0);
+ String ins="\n";
+ clipboard += ins;
}
- String clipboard = OS::get_singleton()->get_clipboard();
_insert_text_at_cursor(clipboard);
update();
-
}
void TextEdit::select_all() {
@@ -3418,11 +3394,15 @@ void TextEdit::undo() {
else
undo_stack_pos=undo_stack_pos->prev();
- _do_text_op( undo_stack_pos->get(),true);
+ TextOperation op = undo_stack_pos->get();
+ _do_text_op(op, true);
+ current_op.version=op.prev_version;
if(undo_stack_pos->get().chain_backward) {
do {
undo_stack_pos = undo_stack_pos->prev();
- _do_text_op(undo_stack_pos->get(), true);
+ op = undo_stack_pos->get();
+ _do_text_op(op, true);
+ current_op.version = op.prev_version;
} while(!undo_stack_pos->get().chain_forward);
}
@@ -3438,15 +3418,19 @@ void TextEdit::redo() {
if (undo_stack_pos==NULL)
return; //nothing to do.
- _do_text_op(undo_stack_pos->get(), false);
+ TextOperation op = undo_stack_pos->get();
+ _do_text_op(op, false);
+ current_op.version = op.version;
if(undo_stack_pos->get().chain_forward) {
do {
undo_stack_pos=undo_stack_pos->next();
- _do_text_op(undo_stack_pos->get(), false);
+ op = undo_stack_pos->get();
+ _do_text_op(op, false);
+ current_op.version = op.version;
} while(!undo_stack_pos->get().chain_backward);
}
- cursor_set_line(undo_stack_pos->get().from_line);
- cursor_set_column(undo_stack_pos->get().from_column);
+ cursor_set_line(undo_stack_pos->get().to_line);
+ cursor_set_column(undo_stack_pos->get().to_column);
undo_stack_pos=undo_stack_pos->next();
update();
}
@@ -3495,6 +3479,13 @@ void TextEdit::_push_current_op() {
}
+void TextEdit::set_tab_size(const int p_size) {
+ ERR_FAIL_COND(p_size <= 0);
+ tab_size = p_size;
+ text.set_tab_size(p_size);
+ update();
+}
+
void TextEdit::set_draw_tabs(bool p_draw) {
draw_tabs=p_draw;
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 2eff8e89c7..d38c57804d 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -156,6 +156,7 @@ class TextEdit : public Control {
int from_line,from_column;
int to_line, to_column;
String text;
+ uint32_t prev_version;
uint32_t version;
bool chain_forward;
bool chain_backward;
@@ -378,7 +379,7 @@ public:
void redo();
void clear_undo_history();
-
+ void set_tab_size(const int p_size);
void set_draw_tabs(bool p_draw);
bool is_drawing_tabs() const;
diff --git a/scene/resources/baked_light.cpp b/scene/resources/baked_light.cpp
index 31282a0274..aa4aae03cb 100644
--- a/scene/resources/baked_light.cpp
+++ b/scene/resources/baked_light.cpp
@@ -256,6 +256,38 @@ float BakedLight::get_ao_strength() const {
return ao_strength;
}
+void BakedLight::set_realtime_color_enabled(const bool p_realtime_color_enabled) {
+
+ VS::get_singleton()->baked_light_set_realtime_color_enabled(baked_light, p_realtime_color_enabled);
+}
+
+bool BakedLight::get_realtime_color_enabled() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_color_enabled(baked_light);
+}
+
+
+void BakedLight::set_realtime_color(const Color &p_realtime_color) {
+
+ VS::get_singleton()->baked_light_set_realtime_color(baked_light, p_realtime_color);
+}
+
+Color BakedLight::get_realtime_color() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_color(baked_light);
+}
+
+void BakedLight::set_realtime_energy(const float p_realtime_energy) {
+
+ VS::get_singleton()->baked_light_set_realtime_energy(baked_light, p_realtime_energy);
+}
+
+float BakedLight::get_realtime_energy() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_energy(baked_light);
+}
+
+
void BakedLight::set_energy_multiplier(float p_multiplier){
@@ -434,6 +466,15 @@ void BakedLight::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_ao_strength","ao_strength"),&BakedLight::set_ao_strength);
ObjectTypeDB::bind_method(_MD("get_ao_strength"),&BakedLight::get_ao_strength);
+ ObjectTypeDB::bind_method(_MD("set_realtime_color_enabled", "enabled"), &BakedLight::set_realtime_color_enabled);
+ ObjectTypeDB::bind_method(_MD("get_realtime_color_enabled"), &BakedLight::get_realtime_color_enabled);
+
+ ObjectTypeDB::bind_method(_MD("set_realtime_color", "tint"), &BakedLight::set_realtime_color);
+ ObjectTypeDB::bind_method(_MD("get_realtime_color"), &BakedLight::get_realtime_color);
+
+ ObjectTypeDB::bind_method(_MD("set_realtime_energy", "energy"), &BakedLight::set_realtime_energy);
+ ObjectTypeDB::bind_method(_MD("get_realtime_energy"), &BakedLight::get_realtime_energy);
+
ObjectTypeDB::bind_method(_MD("set_format","format"),&BakedLight::set_format);
ObjectTypeDB::bind_method(_MD("get_format"),&BakedLight::get_format);
@@ -480,6 +521,11 @@ void BakedLight::_bind_methods(){
ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_radius",PROPERTY_HINT_RANGE,"0.0,16.0,0.01"),_SCS("set_ao_radius"),_SCS("get_ao_radius"));
ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_strength",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_ao_strength"),_SCS("get_ao_strength"));
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "realtime/enabled"), _SCS("set_realtime_color_enabled"), _SCS("get_realtime_color_enabled"));
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "realtime/color", PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_realtime_color"), _SCS("get_realtime_color"));
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "realtime/energy", PROPERTY_HINT_RANGE, "0.01,4096.0,0.01"), _SCS("set_realtime_energy"), _SCS("get_realtime_energy"));
+
+
BIND_CONSTANT( MODE_OCTREE );
BIND_CONSTANT( MODE_LIGHTMAPS );
diff --git a/scene/resources/baked_light.h b/scene/resources/baked_light.h
index 41e1e5f9e0..f9a1368e8d 100644
--- a/scene/resources/baked_light.h
+++ b/scene/resources/baked_light.h
@@ -116,6 +116,15 @@ public:
void set_ao_strength(float p_ao_strength);
float get_ao_strength() const;
+ void set_realtime_color_enabled(const bool p_enabled);
+ bool get_realtime_color_enabled() const;
+
+ void set_realtime_color(const Color& p_realtime_color);
+ Color get_realtime_color() const;
+
+ void set_realtime_energy(const float p_realtime_energy);
+ float get_realtime_energy() const;
+
void set_bake_flag(BakeFlags p_flags,bool p_enable);
bool get_bake_flag(BakeFlags p_flags) const;
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index eabc84c41e..40ae26ba5d 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -1351,13 +1351,21 @@ ShaderGraph::ShaderGraph(Mode p_mode) : Shader(p_mode) {
//shader = VisualServer::get_singleton()->shader_create();
_pending_update_shader=false;
- Node out;
- out.id=0;
- out.pos=Vector2(250,20);
- out.type=NODE_OUTPUT;
+
+ Node input;
+ input.id=1;
+ input.pos=Vector2(50,40);
+ input.type=NODE_INPUT;
+
+ Node output;
+ output.id=0;
+ output.pos=Vector2(350,40);
+ output.type=NODE_OUTPUT;
+
for(int i=0;i<3;i++) {
- shader[i].node_map.insert(0,out);
+ shader[i].node_map.insert(0,output);
+ shader[i].node_map.insert(1,input);
}
}