Sleipnir wrote: ↑
A third approach would be to render the unit as <x>*<y>*<z> planes mapped with the different slices through the unit. This might actually be feasible.
I did a hacky test implementation of this approach, and it's certainly the way to go.
The average triangle count is now ~100 per unit, and this makes it much simpler to implement shadows (enable the stencil buffer, project each slice texture onto the ground plane, render shadow color).
I have fixed the lighting problems and added dynamic shadows.
I need to do a bit more work to stop multiple shadows stacking (turrets, legs, etc) and fix some artifacts that can appear.
Looks amazing. When I compare that with Red Alert 2 screenshots I get the impression that Westwood pixelated their Voxels artificially to better fit in to the rest of the sprite based assets. Your rendering looks more smooth and high resolution. Might also be that the comparison with Red Alert 1 terrain and SHPs triggers that feeling.
Sleipnir wrote: ↑
I need to do a bit more work to stop multiple shadows stacking (turrets, legs, etc) and fix some artifacts that can appear.
I like new lighting. I can imagine some better-detailed, community voxels may look just like pre-rendered SHP.
But I have question, it it posible to make turrets to cast shadow on hull (hull's onel on legs, etc)?
Cmd. Matt wrote: ↑Your rendering looks more smooth and high resolution. Might also be that the comparison with Red Alert 1 terrain and SHPs triggers that feeling.
I think this is partly because of the higher resolution RA2 artwork and partly because of the OpenGL texture filtering. The difference is much less dramatic with pixel doubling disabled.
Gangster wrote: ↑But I have question, it it posible to make turrets to cast shadow on hull (hull's onel on legs, etc)?
It would be a simple tweak to draw the turret shadow as it would be projected onto the ground on top of the hull, but this would look wrong. Doing it properly (taking the hull geometry into account) would require a more complicated shadow model. I'd prefer to keep the initial implementation simple, but this is something which could (and probably should) be improved in the future.
RA2 was made by Westwood Pacific, which became EA Pacific and finally EALA. that was not true Westwood Studios. Just one affilated office with same name and logo, but team was different.
Ok so yes technically I am wrong... However Westwood was bought out by EA in 1998. Tiberium sun was already in production before that. When Westwood had to answer to EA they began to be a little more sloppy because of new time constraints.
so yes it was Westwood but they were owned by EA. My bad.... You learn something new everyday XD
I've fixed the sprite/voxel z-sorting and have written Cg shaders, so the core project that I set out to do is essentially complete. There's a bit more refactoring needed, and then everything else is modifying existing engine features (making damaged vehicles smoke, supporting chronosphere preview, the aforementioned harvester dumbness, etc). These latter things are only worth fixing if this code is actually wanted upstream, so we'll see what happens once I get around to filing a pull request on this.
OpenRA.Game/Graphics/WorldRenderer.cs(85,4): error CS0171: Field `OpenRA.Graphics.WorldRenderer.RenderObject.Sprite' must be fully assigned before control leaves the constructor