PixelTool - Voxel-based Vehicle Editor/Renderer

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

andythenorth wrote:So can you auto-upscale it to 2x and 4x? :wink:
Open the Javascript console (Ctrl+Shift+J in Chrome) and enter "scaleVoxels(1)" [2x] or "scaleVoxels(2)" [4x]... It currently does a simple nearest neighbour upscaling, but implementing an algorithm like scale2x (http://scale2x.sourceforge.net/) in 3D would be fairly simple.
Attachments
PixelToolPng.png
PixelToolPng.png (10.27 KiB) Viewed 9245 times
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by andythenorth »

Zephyris wrote:
andythenorth wrote:So can you auto-upscale it to 2x and 4x? :wink:
Open the Javascript console (Ctrl+Shift+J in Chrome) and enter "scaleVoxels(1)" [2x] or "scaleVoxels(2)" [4x]... It currently does a simple nearest neighbour upscaling, but implementing an algorithm like scale2x (http://scale2x.sourceforge.net/) in 3D would be fairly simple.
I love voxels :D
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Phreeze »

i hate them :D i first liked them, in games such as comanche. It looked awesome and was fast, then newer games used the tech too, and it became very weird looking (outcast e.g.). conclusion: just use pure real 3D with an energywasting 350watt gfx-card ^^

@thread: do you plan additional features ?
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

Phreeze wrote:@thread: do you plan additional features ?
If I get time and if I need them... What do you have in mind?
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Phreeze »

nothing special, just curious ;)

for me, when drawing trains, i just see the the height of the --- view has more pixels then my template, perhaps the boxses can have other dimensions !?
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by stevenh »

Zephyris wrote:
Phreeze wrote:@thread: do you plan additional features ?
If I get time and if I need them... What do you have in mind?
Reverse engineer existing sprite? :twisted:
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

stevenh wrote:Reverse engineer existing sprite? :twisted:
That is actually fairly possible; if you assume that that the vehicle sprite is essentially a cuboid of particular dimensions and is symmetrical then there is a 1:1 mapping of / orientation sprite pixels to the surface voxels of a cube... Unshading the sprite would be quite simple too, if you assume that the left side is typically 1 shade darker and the roof is typically 1 or 2 shades lighter.
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Phreeze »

too much assuming there to get a neat result ;)
User avatar
SkiddLow
Route Supervisor
Route Supervisor
Posts: 389
Joined: 09 Jul 2012 00:44
Location: Surabaya
Contact:

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by SkiddLow »

Hello i back again, please make the Zwergauto, Le Chaux, Overcompensator
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

Phreeze wrote:too much assuming there to get a neat result ;)
One way to find out... I'll let you know if I get it working!
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Eddi »

well the maths behind it is actually pretty simple. you overlay the image with a bounding box, and then map each pixel to the corresponding coordinate along the respective side of the bounding box it comes to lie in. the results may not be optimal, but probably a good start if the vehicle is vaguely box-y
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by stevenh »

Zephyris wrote:One way to find out... I'll let you know if I get it working!
We need a like button.


... the next cool idea would be to select a region and decrement all colour indexes to their nearest next non-system colour.
i.e. don't decrement to water, #FFF, CC or fire.
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Phreeze »

that would be nice for the shade-side :D
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

Phreeze wrote:that would be nice for the shade-side :D
The shaded side of the vehicle is already rendered a bit darker, by using exactly the same lighten/darken method that stevenh suggested... That also means a lighten/darken tool would be pretty easy to program if I get a chance...
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by supermop »

It would be interesting to have some means of using 32bpp to render trains that in the spirit of 8bpp - by this I mean, the tool only lets you 'paint' voxels in the traditional colors of the 8b DOS pallet, but then uses 32b colors to shade them with more nuance.

Does anyone have any tips for preventing 'diagonal' and 'round' surfaces from looking so serrated? I wish I could designate a face as diagonal, and have the resultant shade be an average of the shades given by the exposed x and y voxel faces
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Phreeze »

it's difficult. someone said, that "thin" lines should at least be 2pixels wide, details can't be rendered exactly in diagonal views :-/ basically use voxeltool too design the train, then use gimp/photoshop to correct details (like serrated windows in diagonal views etc.)
User avatar
Bob_Mackenzie
Chairman
Chairman
Posts: 823
Joined: 25 Mar 2010 13:36

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Bob_Mackenzie »

I have just taken a quick look at this and it seems pretty intuitive. However being a bit of a klutz I missed having an undo button...

(edit)

(edit 2)

Please ignore edit 1 :)
Attachments
Screen shot
Screen shot
RW.png (17.13 KiB) Viewed 1907 times
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Leanden »

Is there any way to edit the render engine so that the diagonals and verticals scaled differently, it seems a bit rigid with changing the dimensions affecting all the different views with no flexibility. Makes it hard to maintain scales of already drawn sprites from other sources.
Image
CountBuggula
Engineer
Engineer
Posts: 4
Joined: 07 Jun 2017 15:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by CountBuggula »

How difficult would it be to get this to render tracks? I'm working on a monorail trackset, and this has actually given me a great boost in the right direction, but due to elevation changes there are slightly different angles that tracks need to be rendered in for a full trackset compared to what's required for trains.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: PixelTool - Voxel-based Vehicle Editor/Renderer

Post by Zephyris »

@Leanden
It would be possible, but I think you'd get strange aliasing/rounding errors trying to shrink resolution only in some orientations. It's the limitation of using a pixel & palette-based render method.

@CountBuggula
Which orientations are you thinking of? The slopes?
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 15 guests