VisRegions and SoftVolumes

Moderators: Trylon, Paradox

VisRegions and SoftVolumes

Postby Paradox » Tue Apr 01, 2008 4:23 pm

SoftVolumes are finally working to their full potential :D

You can now (with SVN HEAD) apply a softvolume to a sound emitter and have it correctly limit the sound. SoftVolumes for lighting have been working for quite some time, and continue to function in the same way.

Also added is the ability to attach a VisRegion to an object to trigger regions (with softvolumes) where the object is visible or invisible. The key to remember here is that visregions work opposite of what you would expect. You must specify the softvolume regions where the object is invisible.

Code: Select all
[Object Name]:
    visual:
        visregions:
          - "!(MySoftVolume)" #The inverse of my soft volume region
                              #Remember that we are specifying where the object is NOT visible


There are a few more fixes that we want to do for softvolumes and complex softvolumes before we make a new release, but progress is happening fast.

Also note: All of the contrib code has been merged.
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: VisRegions and SoftVolumes

Postby Aloys » Tue Apr 01, 2008 5:08 pm

Good job! :)
Obviously I haven't tested it yet, but the way visregions work really got me scratching my head..
If I am reading your post correctly what we need to do is take *each object* that we want to be dealt with with one (or more) visregion and (in alcscript) tell it in which regions it is not visible. Right?
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: VisRegions and SoftVolumes

Postby Paradox » Tue Apr 01, 2008 6:52 pm

yes... that's why there are RelevanceRegions that aren't per-object and just cut off large chunks of an Age.

Those will be implemented at some point as well.
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: VisRegions and SoftVolumes

Postby Aloys » Tue Apr 01, 2008 8:51 pm

Ok. That will be very usefull to get some serious optimisations done on our Ages :) Although, so far performance hasn't been much of a problem.. Except for Ahra Pahts that is. :?
That's cool about the relevance regions too, no hurry though. :) (*starts refining Pahts.csv*)
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: VisRegions and SoftVolumes

Postby Jojon » Tue Apr 01, 2008 11:56 pm

Can we also have less complex versions of objects, shown in their place, when viewed from a distance?
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: VisRegions and SoftVolumes

Postby Trylon » Wed Apr 02, 2008 9:14 am

Jojon wrote:Can we also have less complex versions of objects, shown in their place, when viewed from a distance?


You can do so by makeing a smart use of VisRegions:

- Make one full-poly object, and assign a vis-region of close range to it.
- Duplicate it, and make it a low poly-version.
- Assign it a vis-region that makes it invisible on close-by.
- Alternatively, give it a vis-region that hides it on both close-range and far-away-range.
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: VisRegions and SoftVolumes

Postby Jojon » Wed Apr 02, 2008 9:26 am

Trylon wrote:You can do so by makeing a smart use of VisRegions:

I was hoping it would be that easy, even if we do not have a full actual LOD mechanism in place. :) Maybe one could use a duplicate of a single region and just flip the normals...
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: VisRegions and SoftVolumes

Postby Aloys » Wed Apr 02, 2008 4:52 pm

Trylon wrote:
Jojon wrote:Can we also have less complex versions of objects, shown in their place, when viewed from a distance?


You can do so by makeing a smart use of VisRegions:

- Make one full-poly object, and assign a vis-region of close range to it.
- Duplicate it, and make it a low poly-version.
- Assign it a vis-region that makes it invisible on close-by.
- Alternatively, give it a vis-region that hides it on both close-range and far-away-range.

Ohhhh.. devilish! And very useful. I love it. :twisted:
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: VisRegions and SoftVolumes

Postby Paradox » Wed Apr 02, 2008 8:21 pm

With the latest commit, complex softvolumes can be created using AlcScript. This greatly reduces the number of objects in the exported files.

The old way used a string to specify a complex softvolume when exporting a light.
Code: Select all
softvolume: "!(U(SoftVol1, I(SV2,SV3), SV4))"


If you had 5 lights that all needed that softvolume, PyPRP would generate 5 softvolume objects (all identical except for the object name). The new method allows you to provide names for your softvolumes and reference them using those names.
Code: Select all
MySoftVolume:
    type: softvolume
    softvolume:
      - type: convex
        softdist: 5
   
      - type: invert
        regions:
          - softvolume:MySoftVolume

[Object Name]:
    type: light
    lamp:
        softvolume: svinvert:MySoftVolume


MySoftVolume is a mesh object in Blender which defines the limits of the volume. In AlcScript a SoftVolumeInvert is created (with the same name as MySoftVolume) which references MySoftVolume. That SoftVolumeInvert is then applied to a lamp object.

To be really creative, you can even make empty objects and attach complex softvolumes to them. Therefore you are not limited to using the names of existing volumes.

As a note, we did leave the existing implementation available (using the strings) as an option. Please let us know if you encounter any bugs :)
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: VisRegions and SoftVolumes

Postby Jojon » Thu Apr 03, 2008 1:32 am

Whoa, I really need to start learning alcscript, I suppose...

I am guessing you can use both the softvolume as it is and its inverted clone, for effect either inside or outside of it? (or is it only surpressed_inside[by use of inverted] that goes?)
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Next

Return to Scripting Journal

Who is online

Users browsing this forum: No registered users and 0 guests

cron