- new Parcel implementation
- update options and creation options for all new resource types and settings
- initial work toward parcel diff loading
- add parcel event endpoints, for
progress
,complete
,failed
events - added ParcelChange type for information on progress or failure events
- added
length
properties for counting resources - added
state
, forunloaded
loading
loaded
- added
listed
which returns an array of resource id's in the parcel - added
loaded
which returns an array of resource id's that are loaded by this parcel - added
oncomplete
,onfailed
andonprogress
handlers in options - added
bytes
,texts
,jsons
,textures
,fonts
,shaders
,sounds
for constructor options - added
is_loaded(id)
- added skipping of already loaded assets
- removed manual
add_*
api's- modify
list
- modify
- ParcelProgress
- added
no_visuals
to bypass the default geometries for custom implementations - complete handler called before fade completes, not after
- prevents "seeing" load complete responses happening
- update for new Parcel event api instead of hijacking the onload/onprogress callbacks
- added
- changed ResourceType.data to ResourceType.bytes and all associated calls/types
- added new resource
load
/fetch
api - all
load
actions return aPromise
- all
fetch
actions return a strong type - added
has
,get
for general queries - added invalidate(id)/destroy(id)
- added a complete set of events for all resources
unknown
/listed
/loading
/loaded
/failed
/destroyed
/invalidated
- added handling of reference counters from
load
calls
- added
reload
api handled by all resource types - added
TextResource
JSONResource
BytesResource
- these all contain a snow
Asset
type - which means:
- previously
res.text
,res.json
andres.bytes
becomes res.asset.text
,res.asset.json
andres.asset.bytes
- previously
- these all contain a snow
- added reference counting for handling
destroy
and sharing- tracked by
Resources
for you onload
calls - will be used in subsequent additions re: parcel diff features
- tracked by
- added resource
state
property, forlisted
,loading
,loaded
,failed
etc - added invalidation and clearing
- invalidate triggers an event, usually from some other event (like file change, context loss)
- clear destroys asset/gpu/memory/other resources and slims down the instance to just state
- clear is auto handled on reload, invalidate, and others
- implement new resource api
- reload()/clear()
- clearer toString details
- Add Texture.default_filter and Texture.default_clamp #246
- this is not retroactive
- only textures created after this will be affected
- Add Texture.max_size():Int
- returns hardware max width/height
- filter and clamp represented by their proper parts
- reduces chance of state desync errors
- to update, set both at once:
filter =
becomesfilter_min = filter_mag =
clamp =
becomesclamp_s = clamp_t =
- removed asset from texture resource
- texture resource contains gpu resource only,
- it shouldn't have been hanging ram references
- removed onload handlers as resources are now imperative
- use a parcel, the preload parcel, or use
Luxe.resources.load_texture(id, options).then(function(texture) { }
- removed from_pixel, from_bytes creation conveniences
- only from pixels because it's not managing a resource
- use
new Texture({ id:.., width:..., height:..., pixels:Uint8Array });
- use
Luxe.snow.assets.image(id)
to get anAssetImage
which gives you the bytes api's if needed - use
texture.submit(pixels)
if updating texture pixels
- added
submit
/fetch
clarity- fetch downloads the texture pixels into a given array
- submit uploads the pixels from the given array
- submits includes TextureSubmitTarget for uploading cubemap faces
- bind state cached in ResourceState so that multiple binds have no real effect
- initial pass on abstractions/flexibility
- add
border
parameter used insubmit
- add
format
parameter to configure the gpu format (i.e GL.RGBA) - add
type
parameter to configure the gpu type, enabling 2D textures or Cube Maps (and future 3D texture types) - add
data_type
parameter to configure the gpu data type (i.e GL.UNSIGNED_BYTE) - add
compressed
flag for handling compressed formats.- only useful right now if you know what you're doing!
- when submitting,
compressedTexImage2D
would be used instead oftexImage2D
- add
- changed
w
andh
toInt
type - added
width
andheight
toFloat
if needed - removed redundant cache values and error prone sync code
- added
bounds
getter, returns aluxe.Rectangle
for convenience - clarified that
mid
,size
,bounds
will return new instances- this is because cached values get modified by user code
- immutability is in the new vector code for later alpha
- implement new resource api
- reload() / clear()
- only set uniforms that are found (not all 8 for no reason)
- added
luxe_no_shader_prefix
define short term- you don't need to define this unless you need to
clone
requires an id for the clone (see below)- removed all inconsistent verbose flags and fixed error logging to be more logical
- unified naming of
vert_id
andfrag_id
- gave a proper resource
id
, must be unique like all resource id's- that means the
|
combined stop gap is gone
- that means the
- when creating or specifying for loading, vert_id, frag_id and id are required
- move to be explicit for usage code clarity
- in the cases where you left one out:
- use 'default' for vert_id
- use
'default'
for untextured and'textured'
otherwise
- implement new resource api
- reload() / clear()
- remove from_string and other static api's
- use
new BitmapFont({ id:, pages:[], font_data:string });
- use
- moved parser and types into luxe/importers/
- add bindTexture( type, tex ) abstraction
- add bindTexture2D/bindTextureCube implementation
- add ResourceState.bound_texture_2D/bound_texture_cube
- for cases where the currently bound TextureID may be useful