Page 1 of 2

Paper Pagodas

PostPosted: Fri Jan 16, 2009 1:52 am
by tikibear
This age is inspired by a toy I have enjoyed since childhood.

I've had the avatar fall inexplicably though floors in this age. Please report that if you encounter it.

Re: Paper Pagodas

PostPosted: Sat Jan 17, 2009 7:33 am
by ametist
Just visited your new age tikibear ;) I like it! :)
Since it's on the public ULM I took the liberty to create an inspectionthread for it :

http://www.guildofmaintainers.org/Forum/viewtopic.php?f=126&t=1241


I didn't fall through, I could walk and swim and climb. There is a corner though, where I got caught
Show Spoiler
and had to use Flymode to get free. ;)

Re: Paper Pagodas

PostPosted: Sat Jan 24, 2009 2:42 am
by tikibear
Thank you for the positive feedback! I hadn't been to the GOM board, before.
The sticky meshes are fixed, though I'm not sure why they were sticky. I made their bounds boxes, rather than triangle meshes. My guess is that the meshes are so shallow that collision detection is confused. I notice that the shallow meshes' rendering gets hosed if the avatar gets too far away from them. This effect is hidden by the mist, fortunately.
Getting transparency to work properly was a chore. I manually adjusted rendering order with parenting and deparenting. Additionally, the waterfalls have pass index 1, everything else has 0. This gives the correct transparency, but kills two-sided meshes, which I'll replace later on.
I made the lake and waterfall materials Z-buffered. This prevents them from occluding the transparent avatar. In Ahnonay, by contrast, the transparent avatar is occluded by the water when in the water. Is that occlusion desirable? I think The Transparent Avatar will be my new cavern name.
Adjusting rendering order makes the waterfalls show up transparent in Blender, which is nice.
I will add more pagodas. The rule is that they must be constructable with the Eames House of Cards. I see on the Eames Office web page that the Giant House of Cards is now available, but the Paper Pagodas are bigger!
I quite like the combination of cards and waterfalls.

Re: Paper Pagodas

PostPosted: Sat Jan 24, 2009 10:52 am
by tikibear
The two-sided objects which stopped rendering two sides worked again when I duplicated them. That's mysterious. They'll show up in version 3.
The areas in shadow are shaded by negative-light lamps.

Re: Paper Pagodas

PostPosted: Tue Jan 27, 2009 12:16 am
by tikibear
I got tired of paper cuts from the paper ladders so I replaced them with bamboo ladders in v3. A few other enhancements are thrown in.

Re: Paper Pagodas

PostPosted: Mon Feb 02, 2009 12:47 pm
by Corvus
I like your age. The new bamboo ladders look very good, although I also liked the ones of paper. And now with the sounds it's a really nice place to go. :)

Re: Paper Pagodas

PostPosted: Fri Mar 20, 2009 1:26 am
by tikibear
I added some greenery. I made a vine texture that can be used on a plane by itself or as a decal on other objects. Blender's key supersampling makes the appropriate alpha. I'm talking about a texture-only decal, not one on a separate object.
The trick to decals is that Blender and Plasma (as loaded by pyPRP) handle scaling and offsets differently. Blender scales textures on their centers. Plasma scales from the upper, left-hand corner. The Y offset has opposite sign for Blender vs. Plasma.
So, to put on a decal I add the texture, with clipping set, to the material of interest. I set the scaling I want. I unwrap the UV map. If the X scale is SX and the Y scale is SY I offset the UV in the UV window by (0.5*(1-1/SX), 0.5*(1/SY-1)). I then play with the offset settings to position the decal the way I like. To see the decal I put a camera in the scene and use it to render a still. The decal shows up in the still. Once the decal is positioned I put the UV back to where it started. I multiply the Y offset by -1. Now, the decal won't be right in the Blender render, but will be right in Plasma.
For the texture used on a plane by itself objects must be ordered so that the plane's object order is ahead of anything that can be behind it in the scene. To order two objects make an object the parent of another, then deparent. The child will be ordered ahead of the parent and be rendered in front. Careful ordering keeps those bothersome halos from appearing around texture panels.

Re: Paper Pagodas

PostPosted: Thu May 28, 2009 11:22 pm
by tikibear
Well, jumping through hoops to be able to preview decals in Blender got old really fast. I patched PyPRP to export texture offsets to match Blender's use of texture offsets. Decals are much faster to set up now.
The patch goes in prp_MatClasses.py to plLayer.FromBlenderMTex(...)

# original offset extraction code
uvmobj.LocX = mtex.ofs[0]
uvmobj.LocY = mtex.ofs[1]

# offsets mapped from Blender to Plasma
uvmobj.locX = 0.5 - 0.5 * mtex.size[0] * trickscale + mtex.ofs[0]
uvmobj.locY = 0.5 - 0.5 * mtex.size[1] * trickscale - mtex.ofs[1]

Note that the Y offset is negated.

Re: Paper Pagodas

PostPosted: Fri May 29, 2009 4:31 am
by Robert The Rebuilder
Well done, tikibear!

Note that for the PyPRP devs to incorporate your fix, you should create your own subdirectory in http://svn.guildofwriters.com/pyprp/contrib, then add your modified prp_MatClasses.py file. They'll receive a SVN alert, prompting them to incorporate it into trunk.

Re: Paper Pagodas

PostPosted: Fri May 29, 2009 4:43 am
by D'Lanor
Also note that you should document any breaking changes and if possible suggest a method to restore the old situation. If for example this changes the texture scaling on all objects in an existing age writers will become very upset to find everything wrong upon their next export.