Page 1 of 2

VisRegions and SoftVolumes

PostPosted: Tue Apr 01, 2008 4:23 pm
by Paradox
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.

Re: VisRegions and SoftVolumes

PostPosted: Tue Apr 01, 2008 5:08 pm
by Aloys
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?

Re: VisRegions and SoftVolumes

PostPosted: Tue Apr 01, 2008 6:52 pm
by Paradox
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.

Re: VisRegions and SoftVolumes

PostPosted: Tue Apr 01, 2008 8:51 pm
by Aloys
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*)

Re: VisRegions and SoftVolumes

PostPosted: Tue Apr 01, 2008 11:56 pm
by Jojon
Can we also have less complex versions of objects, shown in their place, when viewed from a distance?

Re: VisRegions and SoftVolumes

PostPosted: Wed Apr 02, 2008 9:14 am
by Trylon
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.

Re: VisRegions and SoftVolumes

PostPosted: Wed Apr 02, 2008 9:26 am
by Jojon
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...

Re: VisRegions and SoftVolumes

PostPosted: Wed Apr 02, 2008 4:52 pm
by Aloys
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:

Re: VisRegions and SoftVolumes

PostPosted: Wed Apr 02, 2008 8:21 pm
by Paradox
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 :)

Re: VisRegions and SoftVolumes

PostPosted: Thu Apr 03, 2008 1:32 am
by Jojon
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?)