Transparency with Qubicle


#1

From what I’ve seen, transparency has been considered a bit of a problem. I strongly doubt that there would be any problem showing transparent objects in the game. Instead the problem is that Qubicle don’t support transparent voxels. Of course, the optimal solution would be that Qubicle would add support for transparency, but as an alternative I have a suggestion on how to get around it.

The easy part
You put the voxels that you want to be transparent in separate voxel chunks. When you name these voxel chunks in Qubicle you use some tag at the end of the name, like “(Transparent)” or “(Opaque)”. If the transparent voxels are part of a larger voxel chunk then they should have the same name as the solid part, but with the added tag at the end. For example: If you’re modelling a lantern then the voxel chunk that has the solid voxels would be named “Lantern” and the chunk that has the glass would be named “Lantern (Transparent)”. This way Stonehearth’s voxel2polygon converter could recognise them and put them in the same mesh. To make it easier to model, solid voxels should override transparent, so that you don’t have to worry about overlapping.

The tricky part
We need a way to both define the colour for the transparent voxels and how transparent they should be. Here is a couple of possible way to do this.

Edit: New methods!!!
Both more correct and more intuitive than the original idea.

1. Single alpha value
If it would be considered less important to have control of the transparency for each voxel then the transparency value could be a part of the tag in the name. For example “EtherealSword (Transparency 0,5)” or “EtherealSword (Alpha 128)” if you’re making a ghostly, half-transparent sword. You could have more levels of transparency by making more voxel chunks.

2. Alpha voxels (my new favourite)
You include the transparent voxels in the solid voxel chunk. Here you can give them any colour you want. You then make a new voxel chunk (with a tag in the name) that only is in greyscale. This is the alpha value, so lets call them the alpha voxels. If you want a voxel to be solid then you don’t have to add an alpha voxel for it, but if there is an alpha voxel then the corresponding voxel in the solid voxel chunk will be more transparent the darker the alpha voxel is.

Original idea

If you follow the upper and right edge of the big pallet you go from white, to full colour, to black. If you pick a colour along these edges the voxels won’t have any transparency. However, the closer you get to the lower right corner the more transparent the voxels will be.

I realise as I’m writing this that I’m missing the greyscale along the left edge, so here is another way to do it.

Now the closer you get to the bottom center the more transparent the voxels will be.
I know that we would loose more and more of the colour spectra as we get closer to the point with full transparency. However, I think we can get away with this since it gets harder to tell the exact colour when it gets more transparent.

Of course this would all look very weird as long as your still in Qubicle. Translating the colour into the actual transparent colour would have to be done in game. Though if Radiant thinks this is a good idea then maybe they could release a small program that would show models as they would appear in game. This would also be good to see how they look with the in game shading.

That’s all. Comment away! :smile:


#2

Dear Sir @Agon You Have a Great Idea Here, I think this will help Modders everywhere, that have building designs in mind and Great suggestions for the Game.
Just wanted to Wish you Good Luck and please share more tips!


#3

without oversimplifying your suggestion, this sounds similar to the “post processing” that Tom performs on things like Cthulhu’s dangly bits in the campaign video… they look rigid in qubicle, but are rendered independently in 3DSMax… in a nutshell, you are approaching this from a similar angle i suppose, yes?


#4

Well I have certainly found a new curse[quote=“SteveAdamo, post:3, topic:1763”]
Cthulhu’s dangly bits
[/quote]

Thank you Steve, thank you.


#5

@KingMooCow Thank you very much. :smiley:

@SteveAdamo I guess you could say that. Break out the odd parts and treat them separately.

@TobiasSabathius And by Cthulhu’s dangly bits, it does have a nice ring to it. :smile:

Further thoughts
I realised as I was going to bed that I was missing the colours between full colour and grey. Of course this is not good. It might be acceptable though. There probably won’t be a lot of transparent things in the game and you might be able the use the transparency to grey out colours.
However, I have 2 new ways to do it that would be both more correct and more intuitive. Yes, the ideas just keep popping up.

New methods!!!

1. Single alpha value
If it would be considered less important to have control of the transparency for each voxel then the transparency value could be a part of the tag in the name. For example “EtherealSword (Transparency 0,5)” or “EtherealSword (Alpha 128)” if you’re making a ghostly, half-transparent sword. You could have more levels of transparency by making more voxel chunks.

2. Alpha voxels (my new favourite)
You include the transparent voxels in the solid voxel chunk. Here you can give them any colour you want. You then make a new voxel chunk (with a tag in the name) that only is in greyscale. This is the alpha value, so lets call them the alpha voxels. If you want a voxel to be solid then you don’t have to add an alpha voxel for it, but if there is an alpha voxel then the corresponding voxel in the solid voxel chunk will be more transparent the darker the alpha voxel is.

I should add these to the OP.


#6

Sounds complex. All you need is some way of using RGBA instead of RGB, that’s in fact the easy part. The hard part is putting it into the editor, technically you can map a 8b RGB onto a 6b RGBA but it would make your colours look weird as frak and be confusing and difficult to edit for anyone who can’t quickly and easily both visualise colours and do binary conversions in their head.


#7

Yes, like I said in the beginning “the optimal solution would be that Qubicle would add support for transparency”, so “all you need” is for Qubicle to use RGBA. However, if we want to use transparency before that we would have to get around it somehow.
Mapping 8b RGB to 6b RGBA would worlk, but like you said, it would be really hard to understand what colour you’re actually using. You would also loose a lot of the spectrum (64 levels per channel instead of 256).

My absolute favourite so far is the Alpha voxel method. It would be like having RGBA, only that you have the alpha channel in a separate voxel chunk. You can use and see the full range of colours and it’s not too hard to understand what part is affecting the transparency.