Find User here you can look for a user

Voxel Paint v1.6.0 Released

3y
#1
Today I am putting the final touches on v1.6.0 of Voxel Paint, which should be hitting all available platforms in the coming days. This update adds support for new "emissive" voxels, which will be needed for setting up structure lighting on the upcoming My Colony 2.

To use the new feature, you can now right-click on an individual voxel to access a new popup menu. When you turn on emissive for a voxel, you get new options for Glow Radius and Glow Intensity. These properties will determine how My Colony 2 (and other products) will ultimately render the lighting. There is currently no way to set this up on a touch screen device though.


In the View dropdown menu, there is a new Scene Light Color setting which you can use to adjust the lighting in your scene, which is handy for testing out your emissive voxels. The scene lighting data is not saved to the actual .vpp model, but it is used when taking a render of your model. For example, I added a couple of lights to one of @GeneralWadaling 's MC2 models and turned down the lighting in order to test the feature:

Keep in mind that when creating models for My Colony 2, the voxel Glow Radius property is specified in voxels, whereas 16 voxels = 1 tile in the MC2 engine. Also, when you are setting scene brightness in the game, the light intensity level is roughly based on the color itself. For instance, a scene color of white (#ffffff) is like a room with the light turned on, where as a scene color of black (#000000) is basically the same as a white light with the intensity turned down to zero (hope that makes sense).

Some time ago, I believe @Sobeirannovaocc or perhaps someone else requested the ability to be able to pass raw .vpp data into Voxel Paint as an external parameter, and have the app render the file (as opposed to passing in a stored .vpp file url). This functionality is now present in Voxel Paint v1.6.0, and is used like this:

Parameter = emd={(json data here)}
You then base64 encode the above and pass it in as the parameter.

For example, suppose your VPP data looked like this:
{"author":"bastecklein","size":6,"id":"bd8e637f-b5b4-6b59-b663-5363fdd820a0","voxels":[{"x":0,"y":0,"z":0,"c":"#f44336"},{"x":-1,"y":0,"z":0,"c":"#f44336"},{"x":0,"y":-1,"z":0,"c":"#2196F3"},{"x":-1,"y":-1,"z":0,"c":"#2196F3"}],"precompile":{}}
You would convert that object into a string and put emd= in front of it:
emd={"author":"bastecklein","size":6,"id":"bd8e637f-b5b4-6b59-b663-5363fdd820a0","voxels":[{"x":0,"y":0,"z":0,"c":"#f44336"},{"x":-1,"y":0,"z":0,"c":"#f44336"},{"x":0,"y":-1,"z":0,"c":"#2196F3"},{"x":-1,"y":-1,"z":0,"c":"#2196F3"}],"precompile":{}}
You then base64 encode that entire string:
ZW1kPXsiYXV0aG9yIjoiYmFzdGVja2xlaW4iLCJzaXplIjo2LCJpZCI6ImJkOGU2MzdmLWI1YjQtNmI1OS1iNjYzLTUzNjNmZGQ4MjBhMCIsInZveGVscyI6W3sieCI6MCwieSI6MCwieiI6MCwiYyI6IiNmNDQzMzYifSx7IngiOi0xLCJ5IjowLCJ6IjowLCJjIjoiI2Y0NDMzNiJ9LHsieCI6MCwieSI6LTEsInoiOjAsImMiOiIjMjE5NkYzIn0seyJ4IjotMSwieSI6LTEsInoiOjAsImMiOiIjMjE5NkYzIn1dLCJwcmVjb21waWxlIjp7fX0=
And you can finally build your iFrame URL like this:
https://www.apewebapps.com/voxel-paint/launch/-AABLKTB-ZW1kPXsiYXV0aG9yIjoiYmFzdGVja2xlaW4iLCJzaXplIjo2LCJpZCI6ImJkOGU2MzdmLWI1YjQtNmI1OS1iNjYzLTUzNjNmZGQ4MjBhMCIsInZveGVscyI6W3sieCI6MCwieSI6MCwieiI6MCwiYyI6IiNmNDQzMzYifSx7IngiOi0xLCJ5IjowLCJ6IjowLCJjIjoiI2Y0NDMzNiJ9LHsieCI6MCwieSI6LTEsInoiOjAsImMiOiIjMjE5NkYzIn0seyJ4IjotMSwieSI6LTEsInoiOjAsImMiOiIjMjE5NkYzIn1dLCJwcmVjb21waWxlIjp7fX0=/embedded.html
Click here to test it out, you should get something like this:
The -AABLKTB- part of the URL above is optional, but it does remove the app toolbar, which you will want to do if you are hosting this in an iFrame and are trying to render a sample of the vpp data.

I do not know if browsers will place a limit on how large of a parameter one can pass in as an iFrame URL, but the few vpp files I have tried haven't had an issue, so your mileage may vary.

Finally, I have removed the camera rotation limit that stopped you from looking at the bottom side of a model, so you can now rotate the camera completely to the undersize of the scene.

The next step is to get the lights to actually show up in-game, so that is what I will be working on next. I need to make updates to the VPP Loader script to handle the new lights and emissive voxels, after which I will first implement the changes into the Voxel Playground application for testing.

In terms of My Colony 2, I think that buildings should be limited to between 0 and 1 lights. Above I posted a picture of one of Wadaling's structures with 8 active lights on it, and it does look cool, but that scenario would actually be a complete disaster for this type of game. Since My Colony 2 maps are all designed by the player, it is not possible to pre-compute light maps like would be done in a traditional 3d game. For this reason, I think that MC2 lighting should be limited to specific lighting structures, like the street lamp in MC1.

That said, a structure that has an emissive tile with a Glow Radius of 0 will not actually create a light in the MC2 engine. It will instead make that individual voxel unaffected by environment lighting. meaning the scene could be night time, but that voxel would still shine bright as day:


That said, I think it should still be used sparingly, as juts letting objects react to the general environment will probably generally work out alright.

So that is all for this Voxel Paint update. My next steps are to update the .vpp loader and to get the lighting engine working in the Voxel Playground app. I will post updates on the forum when those tasks are done. Beyond that, we will be ready to have a fully functional night time mode in My Colony 2. Exciting!
Owner of Ape Apps, LLC

Linkback References

Welcome
Ape Apps, LLC is an independent software development company founded in 2010 by Brandon Stecklein. Over the years, Ape Apps has published over 400 apps and games across various platforms. You can get in touch with Brandon on Twitter or by leaving a post on his wall @bastecklein
App of the Day