Forum Replies Created
-
AuthorPosts
-
The ‘Data’ property of array also returns a pointer to the elements, ie: ‘blah.Data’ is same as ‘Varptr blah[0]’.
Actually, I think I might be able to do this just by writing a new ‘light’ shader…will have a play!
I just had a hack around with the simplelight banana, and it is possible for 2d lights to work without normal maps.
Hoever, to make this work, I used a ‘default’ normal of 0,0,1. This is a massive cheat that may or may not look like crap depending on usage.
I’ll leave this hack in (it just allows you to use Image.LoadBump without specifying normal/specular maps) but I think you’ll get the best results kludging your own 2d blending approach together.
To render lights you probably want to do something like using multiply blending to multiply light * scenes colors (result is lighting contribution) and then add this back to the original scene colors. This can be done by drawing the scene to one texture, lighting to another, and copying/drawing one texture to another using multiply/additive blending etc.
Easiest way to do this is probably just to use some 2d blending effect (additive, multiply, both, experiment!) and drawing a yellow ‘spotlight’ image.
Monkey12345678910111213141516171819202122232425262728293031323334#Import "<std>"Using std..Const json:="{~qmyarray~q:[1,~qblah~q,{~qname~q:~qmarky~q}]}"Function Main()local jarr:=JsonObject.Parse( json ).GetArray( "myarray" )For Local i:=0 Until jarr.LengthIf jarr.GetValue( i ).IsNumberPrint jarr.GetNumber( i )Else If jarr.GetValue( i ).IsStringPrint jarr.GetString( i )else If jarr.GetValue( i ).IsObjectLocal jobj:=jarr.GetObject( i )EndifNextEndThere are several ways to do this, but the basic idea is to test the JsonValue type of each element.
But I would have though the format for a tile map would use ‘known’ keys etc. Otherwise, kind of a PITA.
Monkey1234567891011121314151617181920212223242526#Import "<std>"Using std..Const json:="{~qmyarray~q:[ 1,2,3,4,5 ]}"Function Main()Local jobj:JsonObject=JsonObject.Parse( json )Local jarr:JsonArray=jobj.GetArray( "myarray" )Print "Length="+jarr.LengthFor Local i:=0 Until jarr.LengthPrint "Element["+i+"]="+jarr.GetNumber( i )NextEndBoth JsonObject and JsonArray have GetString,GetNumber,GetObject and GetArray methods, JsonObject.GetBlah() is ‘keyed’ by string, JsonArray.GetBlah() is keyed by int index.
It should work with the latest version on develop branch, mainly because this has support for ‘internal::’ storage which you’ll need to load/save purchases.
I’ve been planning on putting together a new binary release all week but keep getting sidetracked – now firmly scheduled for Monday!
That would be great!
Woah, sorry for being a bit slow on this one.
Latest version in github develop branch now has a new Scene.DestroyAllEntities() method.
This will call Destroy on all ‘root’ entities in the scene, which will cause children to be destroyed etc.
The issue is apparently that DK2 (oculus dev kit V2) doesn’t work with the ‘open vr’ API (from valve).
It should work with oculus APIs though so I’ll give that a crack at some point!
Your welcome secondgear, and thanks for the bonus!
I haven’t properly announced it yet, as it really needs the latest monkey release to be usable (ie: ‘internal::’ storage support for saving/loading purchases).
I have tested it with google player/itunes connect and it appears to work as well as monkey-x IAP, but please feel free to let me know about any issue here or even at the itch.io forum!
Have a look at the sprites test.
I think there is something about the introrim.dae model monkey2 doesn’t like. How was it created?
If you replace it with the BirdieFly ‘bird’ model or a plain sphere via Model.CreateSphere() etc lighting behaves as expected.
Actaully, looking at the model in Open 3D ModelViewer (which also uses assimp), some of the model normals appear to be ‘twisted’, ie: they are not pointing ‘out of’ the model but at odd angles to it, in same cases parallel to it. This will certainly make lighting look crappy.
You can use the letterbox layout if you want a fixed render size – see the viewlayout banana.
Just pushed some fixes and changs to develop branch.
Sprites should now use depth buffer properly, and Texture.Flags setter now works.
Also, as a bit of an experiment, I added a TextureRect property to Sprite. This defaults to new Rectf( 0,0,1,1 ) and describes the 4 ‘texture coordinate’ corners of the sprite, ie: you could theoretically use this to pick frames out of an atlas. A better approach might be to add the rects to the material, but this is would involve coming up with a ‘SpriteFrames’ class and/or ‘SpriteAnimations’ class etc. Have to think about this a bit more!
-
AuthorPosts