|
|
Pre rendered game media
About Truespace Archives
These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.
They are retained here for archive purposes only.
Pre rendered game media // Roundtable
Post by dononeton // Sep 2, 2007, 11:57am
|
dononeton
Total Posts: 81
|
What I want to do is make my game environment in TS. I need to render out the entire world to a background image. Then render out each model in that world to its own file. So this game is going to be 2d. Its going to be similar to Baldur's Gate. Its going to look 3d but its 2d. The reason I want to render out everthing first is so everthing will have a shadow(if it is possible to hide object and have them cast shadows that would work) Then render out each model into its own file so I can place them in my editor and set them up with collisions.
I need to render out everthing with the same lighting same camera position and angle. SO my question. Is it possible to make a script to automate this? |
Post by nowherebrain // Sep 2, 2007, 12:44pm
|
nowherebrain
Total Posts: 1062
|
I'm not sure, I know you can to set up the scenes..not sure about scene loading...
Are you using OGL or D3D? Not sure about Ogl, but in D3D even 2D is 3D(as if sprites were pasted to an oriented poygon)...if that makes any sense, or matters to you I don't know??? |
Post by dononeton // Sep 2, 2007, 12:51pm
|
dononeton
Total Posts: 81
|
I want to render them out to images to use as sprites in Torque Game Builder.
Want the world to apperar as 3d, but its 2d. Its easier for one person to make/complete and I dont need a model exporter because I am using .bmp and .png files. I am going to assembly the game scene in the level editor
So basically I will need to render the entire scene. Then go thru all objects in that scene. Grab each objects name so when it renders it knows what to save it. Then move to the next. I could make it myself if I knew what methods are in the script engine |
Post by TomG // Sep 4, 2007, 7:34am
|
TomG
Total Posts: 3397
|
The general approach here that is usually taken is to render each object as a tile - so you wouldn't build the scene in your 3D editor. Instead you would build each element in a separate scene, so just a column, just a ground tile, just a throne, etc.
You then assemble the complete scene in your game engine out of these tiles, allowing continual reuse of course.
This method avoid the need for having to go through and start splitting out the objects from an already completed scene in tS - you just make a scene with nothing in it but the pillar, render. Then a new scene with nothing in it but the throne, render.
This of course also makes it easier to do re-renders and adjustments to individual items.
Alternatively you could render the whole scene, then rather than render out individual objects you would draw a "collision map" which could be just black and white and would dicate which parts are solid and which are not. This way you wouldn't need to place each object separately (I did this in a previous 2D game I worked on). You can either draw the collision map by hand, or you could use solid color shaders in tS to render it out maybe.
There is no automated method in existence yet to do what you are thinking about - maybe a script could be written to do it, not sure (if you are in tS7). One alternative that might work would be to use layered rendering from Lightworks, in the iPak for tS6, or included in tS7 natively. You can choose a "per object" rendering and each object will appear in its own Photoshop layer, allowing you to save it out to its own file if you choose.
That method wouldn't let you get shadows though (since when rendering Object A, its shadow would in fact appear on Object B, so would not be rendered out as part of Object A). The first approach (create each object in its own scene) is the easiest way to capture shadows for the objects (for falling on flat ground anyway).
So there are lots of ways this might be approached, it all depends on what you want to do. I think the first is easiest, creating each tile piece separately (it allows flexibility such as running behind some tiles and in front of others, so you can place pillars in front of and behind the player in the isometric view).
The second of one image plus collision map could work, if it is not a scrolling game.
Per Object rendering to PSD may prove handy too. it really does depend on just exactly how your isometric view would work - if it really is to be like Baldur's Gate, my feeling is that the first approach is the one to take.
HTH!
Tom |
Post by dononeton // Sep 4, 2007, 2:02pm
|
dononeton
Total Posts: 81
|
@TomG
So I need to render each object from the same camera position and angle and the same light setup. So how do I get shadows to be cast on the ground from each object that gets rendered out? Is it possible to have a cast shadow being cast on another object that is transparent or have alphas for each object so I can delete that other object? This would work if I can place my tiles along with there shadows! So would it be wise to render the the "world"(terrain for outsidelevels and the interior structure for interior levels) to have a scale set with the camera ?
The reason I wanted to have my level made in TS was to have the cast shadows on the ground tile. Then parse through the scene and grab a model, render it without the cast shadow along with the proper scale and angle in which the game tiles are based on then put those parse object tile renders in my level editor and placed them where they were in the background tile so they cover up were they were "backed" into the background tile so my object tiles would have collision. The way collision works in TGB is each tile has a 2d polygon collision shape so if I want collisions for my tiles they have to exist in there own tile space. |
Post by nowherebrain // Sep 4, 2007, 4:03pm
|
nowherebrain
Total Posts: 1062
|
You can render shadows for sprites(as part of the image), but the way each engine draws transparency could work differently....alpha blend vs alpha test...or both(2 passes in the shader). |
Post by weaveribm // Sep 4, 2007, 11:03pm
|
weaveribm
Total Posts: 592
|
in D3D even 2D is 3D
Bit early for Zen koans :) but anyway DirectDraw is the 2D component of DirectX
Ah I see what you mean. 2D under D3D is faked yes one of the dimensions is rolled up so small you can't see it so there are only three dimensions if you've been playing with the LE too much :)
Peter |
Post by TomG // Sep 5, 2007, 2:12am
|
TomG
Total Posts: 3397
|
You could use a shadow catching object to catch the shadow. I am not sure that would give you transparency though, but you could try it (rendering to a 32 bit PNG say). There's a shadow catcher built in on the Model side of tS7.5 for Lightworks (or in tS6.6 if you are using that).
Alternatively you could use PSD rendering again here, and render object and shadow to separate layers using a shadow catching object, and then you could at least guarantee getting a transparent shadow by adjusting transparency in Photoshop or similar and saving to 32 bit PNG (you could in fact just use a white plane and skip using a shadow catcher in tS I guess if taking this approach, controlling shadow transparency entirely in the 2D app). This would have the benefit of letting you create whatever your particular engine was expecting all from the same render (shadow as a separate image file for instance if it wanted an image and transparency map in separate files; or 32 bit if it wanted them both combined).
HTH!
Tom |
Post by dononeton // Sep 5, 2007, 3:13pm
|
dononeton
Total Posts: 81
|
Thanks that was very helpful! |
Post by TomG // Sep 6, 2007, 1:32am
|
TomG
Total Posts: 3397
|
Happy to help, I hope it does indeed prove to be useful information! Let us know how you get on! It will be good to know what solution you found works best for the game engine, then other users can learn from your hard work in trying out these various possible solutions :)
And of course I would love to see grabs and screenshots from the game as it develops, it sounds like a cool project.
Thanks!
Tom |
|