small optimizations to isometric light demo
should work faster, and even faster if exported.. as textures have been optimized.
This commit is contained in:
parent
57380f9aba
commit
a6f96f46b7
Binary file not shown.
|
@ -0,0 +1,262 @@
|
|||
[convert_images]
|
||||
|
||||
action="none"
|
||||
compress_quality=0.7
|
||||
formats="png"
|
||||
shrink=1
|
||||
|
||||
[export_filter]
|
||||
|
||||
filter=""
|
||||
type="resources"
|
||||
|
||||
[image_group_files]
|
||||
|
||||
files=["res://faceNormal.png", "normal", "res://faceColor.png", "normal", "res://faceMask.png", "normal"]
|
||||
|
||||
[image_groups]
|
||||
|
||||
normal={"atlas":false, "action":"compress_ram", "shrink":1, "lossy_quality":0.7}
|
||||
|
||||
[platform:Android]
|
||||
|
||||
apk_expansion/SALT=""
|
||||
apk_expansion/enable=false
|
||||
apk_expansion/public_key=""
|
||||
command_line/extra_args=""
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
keystore/release=""
|
||||
keystore/release_password=""
|
||||
keystore/release_user=""
|
||||
one_click_deploy/clear_previous_install=true
|
||||
package/icon=""
|
||||
package/name=""
|
||||
package/signed=true
|
||||
package/unique_name="com.android.noname"
|
||||
permissions/access_checkin_properties=false
|
||||
permissions/access_coarse_location=false
|
||||
permissions/access_fine_location=false
|
||||
permissions/access_location_extra_commands=false
|
||||
permissions/access_mock_location=false
|
||||
permissions/access_network_state=false
|
||||
permissions/access_surface_flinger=false
|
||||
permissions/access_wifi_state=false
|
||||
permissions/account_manager=false
|
||||
permissions/add_voicemail=false
|
||||
permissions/authenticate_accounts=false
|
||||
permissions/battery_stats=false
|
||||
permissions/bind_accessibility_service=false
|
||||
permissions/bind_appwidget=false
|
||||
permissions/bind_device_admin=false
|
||||
permissions/bind_input_method=false
|
||||
permissions/bind_nfc_service=false
|
||||
permissions/bind_notification_listener_service=false
|
||||
permissions/bind_print_service=false
|
||||
permissions/bind_remoteviews=false
|
||||
permissions/bind_text_service=false
|
||||
permissions/bind_vpn_service=false
|
||||
permissions/bind_wallpaper=false
|
||||
permissions/bluetooth=false
|
||||
permissions/bluetooth_admin=false
|
||||
permissions/bluetooth_privileged=false
|
||||
permissions/brick=false
|
||||
permissions/broadcast_package_removed=false
|
||||
permissions/broadcast_sms=false
|
||||
permissions/broadcast_sticky=false
|
||||
permissions/broadcast_wap_push=false
|
||||
permissions/call_phone=false
|
||||
permissions/call_privileged=false
|
||||
permissions/camera=false
|
||||
permissions/capture_audio_output=false
|
||||
permissions/capture_secure_video_output=false
|
||||
permissions/capture_video_output=false
|
||||
permissions/change_component_enabled_state=false
|
||||
permissions/change_configuration=false
|
||||
permissions/change_network_state=false
|
||||
permissions/change_wifi_multicast_state=false
|
||||
permissions/change_wifi_state=false
|
||||
permissions/clear_app_cache=false
|
||||
permissions/clear_app_user_data=false
|
||||
permissions/control_location_updates=false
|
||||
permissions/delete_cache_files=false
|
||||
permissions/delete_packages=false
|
||||
permissions/device_power=false
|
||||
permissions/diagnostic=false
|
||||
permissions/disable_keyguard=false
|
||||
permissions/dump=false
|
||||
permissions/expand_status_bar=false
|
||||
permissions/factory_test=false
|
||||
permissions/flashlight=false
|
||||
permissions/force_back=false
|
||||
permissions/get_accounts=false
|
||||
permissions/get_package_size=false
|
||||
permissions/get_tasks=false
|
||||
permissions/get_top_activity_info=false
|
||||
permissions/global_search=false
|
||||
permissions/hardware_test=false
|
||||
permissions/inject_events=false
|
||||
permissions/install_location_provider=false
|
||||
permissions/install_packages=false
|
||||
permissions/install_shortcut=false
|
||||
permissions/internal_system_window=false
|
||||
permissions/internet=false
|
||||
permissions/kill_background_processes=false
|
||||
permissions/location_hardware=false
|
||||
permissions/manage_accounts=false
|
||||
permissions/manage_app_tokens=false
|
||||
permissions/manage_documents=false
|
||||
permissions/master_clear=false
|
||||
permissions/media_content_control=false
|
||||
permissions/modify_audio_settings=false
|
||||
permissions/modify_phone_state=false
|
||||
permissions/mount_format_filesystems=false
|
||||
permissions/mount_unmount_filesystems=false
|
||||
permissions/nfc=false
|
||||
permissions/persistent_activity=false
|
||||
permissions/process_outgoing_calls=false
|
||||
permissions/read_calendar=false
|
||||
permissions/read_call_log=false
|
||||
permissions/read_contacts=false
|
||||
permissions/read_external_storage=false
|
||||
permissions/read_frame_buffer=false
|
||||
permissions/read_history_bookmarks=false
|
||||
permissions/read_input_state=false
|
||||
permissions/read_logs=false
|
||||
permissions/read_phone_state=false
|
||||
permissions/read_profile=false
|
||||
permissions/read_sms=false
|
||||
permissions/read_social_stream=false
|
||||
permissions/read_sync_settings=false
|
||||
permissions/read_sync_stats=false
|
||||
permissions/read_user_dictionary=false
|
||||
permissions/reboot=false
|
||||
permissions/receive_boot_completed=false
|
||||
permissions/receive_mms=false
|
||||
permissions/receive_sms=false
|
||||
permissions/receive_wap_push=false
|
||||
permissions/record_audio=false
|
||||
permissions/reorder_tasks=false
|
||||
permissions/restart_packages=false
|
||||
permissions/send_respond_via_message=false
|
||||
permissions/send_sms=false
|
||||
permissions/set_activity_watcher=false
|
||||
permissions/set_alarm=false
|
||||
permissions/set_always_finish=false
|
||||
permissions/set_animation_scale=false
|
||||
permissions/set_debug_app=false
|
||||
permissions/set_orientation=false
|
||||
permissions/set_pointer_speed=false
|
||||
permissions/set_preferred_applications=false
|
||||
permissions/set_process_limit=false
|
||||
permissions/set_time=false
|
||||
permissions/set_time_zone=false
|
||||
permissions/set_wallpaper=false
|
||||
permissions/set_wallpaper_hints=false
|
||||
permissions/signal_persistent_processes=false
|
||||
permissions/status_bar=false
|
||||
permissions/subscribed_feeds_read=false
|
||||
permissions/subscribed_feeds_write=false
|
||||
permissions/system_alert_window=false
|
||||
permissions/transmit_ir=false
|
||||
permissions/uninstall_shortcut=false
|
||||
permissions/update_device_stats=false
|
||||
permissions/use_credentials=false
|
||||
permissions/use_sip=false
|
||||
permissions/vibrate=false
|
||||
permissions/wake_lock=false
|
||||
permissions/write_apn_settings=false
|
||||
permissions/write_calendar=false
|
||||
permissions/write_call_log=false
|
||||
permissions/write_contacts=false
|
||||
permissions/write_external_storage=false
|
||||
permissions/write_gservices=false
|
||||
permissions/write_history_bookmarks=false
|
||||
permissions/write_profile=false
|
||||
permissions/write_secure_settings=false
|
||||
permissions/write_settings=false
|
||||
permissions/write_sms=false
|
||||
permissions/write_social_stream=false
|
||||
permissions/write_sync_settings=false
|
||||
permissions/write_user_dictionary=false
|
||||
screen/orientation=0
|
||||
screen/support_large=true
|
||||
screen/support_normal=true
|
||||
screen/support_small=true
|
||||
screen/support_xlarge=true
|
||||
user_permissions/0=""
|
||||
user_permissions/1=""
|
||||
user_permissions/10=""
|
||||
user_permissions/11=""
|
||||
user_permissions/12=""
|
||||
user_permissions/13=""
|
||||
user_permissions/14=""
|
||||
user_permissions/15=""
|
||||
user_permissions/16=""
|
||||
user_permissions/17=""
|
||||
user_permissions/18=""
|
||||
user_permissions/19=""
|
||||
user_permissions/2=""
|
||||
user_permissions/3=""
|
||||
user_permissions/4=""
|
||||
user_permissions/5=""
|
||||
user_permissions/6=""
|
||||
user_permissions/7=""
|
||||
user_permissions/8=""
|
||||
user_permissions/9=""
|
||||
version/code=1
|
||||
version/name="1.0"
|
||||
|
||||
[platform:BlackBerry 10]
|
||||
|
||||
package/category="core.games"
|
||||
package/custom_template=""
|
||||
package/description="Game made with Godot Engine"
|
||||
package/icon=""
|
||||
package/name=""
|
||||
package/unique_name="com.godot.noname"
|
||||
release/author="Cert. Name"
|
||||
release/author_id="Cert. ID"
|
||||
version/code=1
|
||||
version/name="1.0"
|
||||
|
||||
[platform:HTML5]
|
||||
|
||||
browser/enable_run=false
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
options/memory_size=3
|
||||
|
||||
[platform:Linux X11]
|
||||
|
||||
binary/64_bits=true
|
||||
custom_binary/debug=""
|
||||
custom_binary/release=""
|
||||
resources/pack_mode=1
|
||||
|
||||
[platform:Mac OSX]
|
||||
|
||||
application/64_bits=false
|
||||
application/copyright=""
|
||||
application/icon=""
|
||||
application/identifier="com.godot.macgame"
|
||||
application/info="This Game is Nice"
|
||||
application/name=""
|
||||
application/short_version="1.0"
|
||||
application/signature="godotmacgame"
|
||||
application/version="1.0"
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
display/high_res=false
|
||||
|
||||
[platform:Windows Desktop]
|
||||
|
||||
binary/64_bits=true
|
||||
custom_binary/debug=""
|
||||
custom_binary/release=""
|
||||
resources/pack_mode=1
|
||||
|
||||
[script]
|
||||
|
||||
action="compile"
|
||||
encrypt_key=""
|
Binary file not shown.
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 54 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
@ -23,7 +23,7 @@ Rect2 Light2D::get_item_rect() const {
|
|||
|
||||
Size2i s;
|
||||
|
||||
s = texture->get_size();
|
||||
s = texture->get_size()*scale;
|
||||
Point2i ofs=texture_offset;
|
||||
ofs-=s/2;
|
||||
|
||||
|
@ -63,6 +63,8 @@ void Light2D::set_texture_offset( const Vector2& p_offset) {
|
|||
|
||||
texture_offset=p_offset;
|
||||
VS::get_singleton()->canvas_light_set_texture_offset(canvas_light,texture_offset);
|
||||
item_rect_changed();
|
||||
|
||||
}
|
||||
|
||||
Vector2 Light2D::get_texture_offset() const {
|
||||
|
@ -87,11 +89,27 @@ void Light2D::set_height( float p_height) {
|
|||
VS::get_singleton()->canvas_light_set_height(canvas_light,height);
|
||||
|
||||
}
|
||||
|
||||
|
||||
float Light2D::get_height() const {
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
void Light2D::set_scale( float p_scale) {
|
||||
|
||||
scale=p_scale;
|
||||
VS::get_singleton()->canvas_light_set_scale(canvas_light,scale);
|
||||
item_rect_changed();
|
||||
|
||||
}
|
||||
|
||||
|
||||
float Light2D::get_scale() const {
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
void Light2D::set_z_range_min( int p_min_z) {
|
||||
|
||||
z_min=p_min_z;
|
||||
|
@ -242,6 +260,10 @@ void Light2D::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("set_height","height"),&Light2D::set_height);
|
||||
ObjectTypeDB::bind_method(_MD("get_height"),&Light2D::get_height);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_scale","scale"),&Light2D::set_scale);
|
||||
ObjectTypeDB::bind_method(_MD("get_scale"),&Light2D::get_scale);
|
||||
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_z_range_min","z"),&Light2D::set_z_range_min);
|
||||
ObjectTypeDB::bind_method(_MD("get_z_range_min"),&Light2D::get_z_range_min);
|
||||
|
||||
|
@ -276,6 +298,7 @@ void Light2D::_bind_methods() {
|
|||
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::REAL,"scale",PROPERTY_HINT_RANGE,"0.01,4096,0.01"),_SCS("set_scale"),_SCS("get_scale"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"subtract"),_SCS("set_subtract_mode"),_SCS("get_subtract_mode"));
|
||||
ADD_PROPERTY( PropertyInfo(Variant::REAL,"range/height"),_SCS("set_height"),_SCS("get_height"));
|
||||
|
@ -299,6 +322,7 @@ Light2D::Light2D() {
|
|||
shadow=false;
|
||||
color=Color(1,1,1);
|
||||
height=0;
|
||||
scale=1.0;
|
||||
z_min=-1024;
|
||||
z_max=1024;
|
||||
layer_min=0;
|
||||
|
|
|
@ -12,6 +12,7 @@ private:
|
|||
bool shadow;
|
||||
Color color;
|
||||
float height;
|
||||
float scale;
|
||||
int z_min;
|
||||
int z_max;
|
||||
int layer_min;
|
||||
|
@ -50,6 +51,9 @@ public:
|
|||
void set_height( float p_height);
|
||||
float get_height() const;
|
||||
|
||||
void set_scale( float p_scale);
|
||||
float get_scale() const;
|
||||
|
||||
void set_z_range_min( int p_min_z);
|
||||
int get_z_range_min() const;
|
||||
|
||||
|
|
|
@ -321,6 +321,13 @@ void ImageTexture::premultiply_alpha() {
|
|||
}
|
||||
}
|
||||
|
||||
void ImageTexture::normal_to_xy() {
|
||||
|
||||
Image img = get_data();
|
||||
img.normalmap_to_xy();
|
||||
create_from_image(img,flags);
|
||||
}
|
||||
|
||||
bool ImageTexture::has_alpha() const {
|
||||
|
||||
return ( format==Image::FORMAT_GRAYSCALE_ALPHA || format==Image::FORMAT_INDEXED_ALPHA || format==Image::FORMAT_RGBA );
|
||||
|
@ -405,9 +412,11 @@ void ImageTexture::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("get_lossy_storage_quality"),&ImageTexture::get_lossy_storage_quality);
|
||||
ObjectTypeDB::bind_method(_MD("fix_alpha_edges"),&ImageTexture::fix_alpha_edges);
|
||||
ObjectTypeDB::bind_method(_MD("premultiply_alpha"),&ImageTexture::premultiply_alpha);
|
||||
ObjectTypeDB::bind_method(_MD("normal_to_xy"),&ImageTexture::normal_to_xy);
|
||||
ObjectTypeDB::bind_method(_MD("set_size_override","size"),&ImageTexture::set_size_override);
|
||||
ObjectTypeDB::set_method_flags(get_type_static(),_SCS("fix_alpha_edges"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR);
|
||||
ObjectTypeDB::set_method_flags(get_type_static(),_SCS("premultiply_alpha"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR);
|
||||
ObjectTypeDB::set_method_flags(get_type_static(),_SCS("normal_to_xy"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR);
|
||||
ObjectTypeDB::bind_method(_MD("_reload_hook","rid"),&ImageTexture::_reload_hook);
|
||||
|
||||
|
||||
|
|
|
@ -146,6 +146,8 @@ public:
|
|||
|
||||
void fix_alpha_edges();
|
||||
void premultiply_alpha();
|
||||
void normal_to_xy();
|
||||
|
||||
|
||||
void set_size_override(const Size2& p_size);
|
||||
|
||||
|
|
|
@ -577,6 +577,7 @@ public:
|
|||
Color color;
|
||||
Matrix32 xform;
|
||||
float height;
|
||||
float scale;
|
||||
int z_min;
|
||||
int z_max;
|
||||
int layer_min;
|
||||
|
@ -614,6 +615,7 @@ public:
|
|||
layer_min=0;
|
||||
layer_max=0;
|
||||
item_mask=1;
|
||||
scale=1.0;
|
||||
item_shadow_mask=-1;
|
||||
subtract=false;
|
||||
texture_cache=NULL;
|
||||
|
|
|
@ -3899,6 +3899,15 @@ void VisualServerRaster::canvas_light_set_transform(RID p_light, const Matrix32&
|
|||
clight->xform=p_transform;
|
||||
|
||||
}
|
||||
void VisualServerRaster::canvas_light_set_scale(RID p_light, float p_scale) {
|
||||
|
||||
Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light);
|
||||
ERR_FAIL_COND(!clight);
|
||||
clight->scale=p_scale;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void VisualServerRaster::canvas_light_set_texture(RID p_light, RID p_texture){
|
||||
|
||||
Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light);
|
||||
|
@ -6937,6 +6946,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_
|
|||
if (cl->enabled && cl->texture.is_valid()) {
|
||||
//not super efficient..
|
||||
Size2 tsize(rasterizer->texture_get_width(cl->texture),rasterizer->texture_get_height(cl->texture));
|
||||
tsize*=cl->scale;
|
||||
Vector2 offset=tsize/2.0;
|
||||
cl->rect_cache=Rect2(-offset+cl->texture_offset,tsize);
|
||||
cl->xform_cache=xf * cl->xform;
|
||||
|
|
|
@ -1157,6 +1157,7 @@ public:
|
|||
virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas);
|
||||
virtual void canvas_light_set_enabled(RID p_light, bool p_enabled);
|
||||
virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform);
|
||||
virtual void canvas_light_set_scale(RID p_light, float p_scale);
|
||||
virtual void canvas_light_set_texture(RID p_light, RID p_texture);
|
||||
virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset);
|
||||
virtual void canvas_light_set_color(RID p_light, const Color& p_color);
|
||||
|
|
|
@ -1151,6 +1151,7 @@ public:
|
|||
FUNC2(canvas_light_attach_to_canvas,RID,RID);
|
||||
FUNC2(canvas_light_set_enabled,RID,bool);
|
||||
FUNC2(canvas_light_set_transform,RID,const Matrix32&);
|
||||
FUNC2(canvas_light_set_scale,RID,float);
|
||||
FUNC2(canvas_light_set_texture,RID,RID);
|
||||
FUNC2(canvas_light_set_texture_offset,RID,const Vector2&);
|
||||
FUNC2(canvas_light_set_color,RID,const Color&);
|
||||
|
|
|
@ -1005,6 +1005,7 @@ public:
|
|||
virtual RID canvas_light_create()=0;
|
||||
virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas)=0;
|
||||
virtual void canvas_light_set_enabled(RID p_light, bool p_enabled)=0;
|
||||
virtual void canvas_light_set_scale(RID p_light, float p_scale)=0;
|
||||
virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform)=0;
|
||||
virtual void canvas_light_set_texture(RID p_light, RID p_texture)=0;
|
||||
virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset)=0;
|
||||
|
|
Loading…
Reference in New Issue