GrimoireGL / GrimoireJS

A WebGL framework for Web development.
https://grimoire.gl
MIT License
350 stars 24 forks source link

Prepareing for releasing v0.13.0 #411

Closed kyasbal closed 7 years ago

kyasbal commented 7 years ago

Core(grimoirejs)

implement GrimoireInterface#overrideNodeDeclaration

There was some cases needs to overrides default component set or values of node declaration.

Declaration

   gr.overrideDeclaration(addComponent:string[],defaults:{[attrName:string]:any});
   gr.overrideDeclaration(addComponent:string[]);
   gr.overrideDeclaration(defaults:{[attrName:string]:any});

add freezeAttributes argument to GrimoireInterface#registerNode

When you add new node just modifying default value of node. You might needs to prevent that attribute modified.

Assume you needs to add <cube> that is mostly same as <mesh/>. But just modifying default value of geometry attribute. You might notice that if user modified geometry attribute manually, that makes that node not rendering cube mesh.

Declaration

gr.registerNode
(name:string,components:string[],defaults?:{[attrName:string]:any},
super?:string,freezeAttributes:string[]);

New feature included in registerNode is the last attribute of that method. If developer registered new node with this attribute, user can not interact with goml file and javascript API.

implement GomlNode#findComponentInAncesotor

Declaration

findComponentInAncestor<T>(name:string|NSIdentity):T;
findComponentInAncestor<T>(ctor:new ()=> T):T;

Removed deprecated API

Add missed method GomlNode#removeComponent

Component#getAttribute should thorw an error if the specified attribute was not found

NodeInterface#addChildByName should receive optional components

fundamental(Renderer)

Migrate math related converters into 'grimoirejs-math'

Implement technique feature in material

The term Technique is same as HLSL. Users now can declare technique in material. And technique attribute of renderer-XXX would accept the string specyfing which techhnique should be used.

Refactor materials

For separating sort parser in future, parsing and instanciating shaders should clearly separated.

By this refactoring, sort syntax would change a little.

@Pass

// some shaders

@Pass should have { and } to specify the region of pass.

@Pass{
  // some shader
}

NOTE: this is just for refactoring, but including breaking change

moajo commented 7 years ago

<OptionalComponent enabled = "false"/>

moajo commented 7 years ago

freezeAttibuteは、goml、nodeInterfaceからの操作を拒否し例外を投げるようになるが、それ以外からは普通に操作できる。