PyPRP and behavior of lamps applied to objects

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

PyPRP and behavior of lamps applied to objects

Postby dendwaler » Tue May 03, 2011 2:47 am

When making an export of an age, i can see that all lamps in the age are applied to any not shadeless object in the age.
It seems more logic to me, that it should only be applied to not shadeless objects within the same "visiual region." as the lamp itself is.
Would'nt that be less stressing the Plasma engine?
or is it not possible?
Those wonderfull Worlds are called " Ages" , because that is what it takes to build one.



Watch my latest Video Or even better..... watch the Cathedral's Complete Walkthrough made by Suleika!
User avatar
dendwaler
 
Posts: 936
Joined: Mon Jun 22, 2009 10:49 am
Location: Nederland

Re: PyPRP and behavior of lamps applied to objects

Postby D'Lanor » Tue May 03, 2011 3:13 am

You are right, it makes no sense at all to attach a spotlight with a limited range to an object that is miles away. The engine still has to do the calculations before it concludes that the effect is zero.

I believe that was done to make things easy. IMO it was a bad idea but you have to keep in mind that back when that decision was made there weren't many large ages. In Adrael btw nearly all objects are set to shadeless and shaded by vertex painting. When done well vertex painting looks better than having Plasma do the shading dynamically.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: PyPRP and behavior of lamps applied to objects

Postby tachzusamm » Tue May 03, 2011 8:38 am

What D'Lanor said, plus:

You mostly don't even have to do Vertex Painting by hand - Blender can do this for you, taking the currently available lights into account.

How it works:
Assume you have an object which currently does NOT already have a Vertex Color layer.
When you create a new Vertex Color layer (under Editing(F9) => Mesh), so when you click the New button there, Blender calculates the current shading, based on:
a) The texture(s) applied to the object
b) The object's material color
c) The shadeless setting (which should be OFF, otherwise lamps are not taken into account)
and assigns a mixture of all three influences as the new default vertex painting for this object.

A new Vertex Color layer is also automatically created once you enter Vertex Paint mode, if there is not already one available.

The normal workflow for getting similar shading like the URU Plasma shading:
1. Select an object (in Object Mode)
2. Turn it's texture(s) OFF temporarily (Shading => Material => Texture => Uncheck) (unless you want to get the vertex colors influenced by the textures as well, e.g. to amplify its colors)
3. MAYBE set the Material Color to white temporarily (only needed if the result is too biased by the color)
(HINT: Instead of resetting the material color, it's faster to check "VCol Paint" temporarily, which will ignore the Mat.Color as well)
4. Set Shadeless to OFF (because you want the lamps do the trick)
5. Switch to Vertex Paint mode, remove the Vertex Color layer, and immeditely create a new one.
(HINT: You can also use "Set Shaded Vertex Colors" from the Paint menu in Vertex Paint mode, instead of removing the Vertex Color layer and applying a new one)

Done. Almost.

Now you may notice that Faces seem to be flat colored, and the object does not appear smooth.
Still in Vertex Paint mode and in the Editing panel, you will notice a Blur button under Paint - select this, and click once on your object - then the vertex colors get smoothed.

Finally re-enable your Material settings (Textures enable, VCol Paint disable), and of course now ENABLE Shadeless.
It should work faster if you do all objects sharing the same material in one batch - this way you have to disable / re-enable the textures, colors and Shadeless flag only once.

Do some tests with, for example, a small sphere, to get a feeling how it works. It's really easy and fast, once you got the trick. ;)


Oh, and in case it does not work as expected:
Regions, Colliders, or other in URU normally not visible objects can BLOCK lamp sources in Blender (although this mostly happens when baking).
So it's a good advice to disable ALL renderability buttons for such region/collider objects in the outliner.
But NOT for normal objects of course, otherwise lightmap baking will fail.
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: PyPRP and behavior of lamps applied to objects

Postby Paradox » Tue May 03, 2011 8:44 am

PyPRP2 will have the option to automatically bake vertex paint based on the lamps in the scene. This is very similar to how Cyan's plugin for 3DS Max works.

Regarding lights in PyPRP1... I know the scope of lamps can be limited to certain objects with AlcScript, and there used to be a way to do it with property fields. There are definitely some disadvantages to the current system.
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: PyPRP and behavior of lamps applied to objects

Postby N. Sigismund » Tue May 03, 2011 10:33 am

Max and the PlasmaMax plugin have a few tricks for regulating lights - firstly, you can simply tell the Max light in question to only light (and cast shadows) onto certain objects, or to exclude certain objects from its light. You can also place everything in a certain area into a certain page file, move that page file to a seperate Max file and then work on lighting for it there, AFAIK - I've been intending to test that out with Llantern for a little while. That can be done without touching any script. Seeing similar functionality in PyPRP2 would be fantastic.

I'd somewhat agree with D'lanor's comment about manually doing vertex painting, but I believe that the best workflow (for Max, anyway) is getting the plugin to do foundation work, then applying additional vertex painting, and finally light maps. Light maps obviously increase the size of your texture PRP, but it's the very best way that I've found of doing static lighting.
For reference:
IC: Nye Morgan
OOC: Sigismund, Nye, Huw Dawson
N. Sigismund
 
Posts: 212
Joined: Tue Jun 08, 2010 10:39 am


Return to Building

Who is online

Users browsing this forum: No registered users and 2 guests

cron