VisRegions and SoftVolumes

Moderators: Paradox, Trylon

Paradox
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada
Contact:

VisRegions and SoftVolumes

Post 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.
User avatar
Aloys
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
MOULa KI#: 0
Location: France (GMT +1)
Contact:

Re: VisRegions and SoftVolumes

Post 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?
Paradox
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada
Contact:

Re: VisRegions and SoftVolumes

Post 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.
User avatar
Aloys
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
MOULa KI#: 0
Location: France (GMT +1)
Contact:

Re: VisRegions and SoftVolumes

Post 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*)
Jojon
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: VisRegions and SoftVolumes

Post by Jojon »

Can we also have less complex versions of objects, shown in their place, when viewed from a distance?
User avatar
Trylon
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
MOULa KI#: 0
Location: Gone from Uru

Re: VisRegions and SoftVolumes

Post 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.
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
Jojon
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: VisRegions and SoftVolumes

Post 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...
User avatar
Aloys
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
MOULa KI#: 0
Location: France (GMT +1)
Contact:

Re: VisRegions and SoftVolumes

Post 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:
Paradox
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada
Contact:

Re: VisRegions and SoftVolumes

Post 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 :)
Jojon
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: VisRegions and SoftVolumes

Post 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?)
Locked

Return to “Scripting Journal”