mcjSphericalUV - Spherical UV mapper - script for DS 1, 2, 3, 4.0 and 4.5+

mCasualmCasual Posts: 4,607
edited June 2014 in Freebies

--------------->

https://sites.google.com/site/mcasualsdazscripts4/mcjsphericaluv

the idea is - you select objects in your scene and the script creates a copy of that object on disk

but, the UV map ( which governs the placement of texture-images on the surfaces ) is projected on the surfaces from either

- the position of the camera
or
- point ( 0, 0, 0 )

---------------

it could solve a problem like : you have an object which looks catastrophically not right when you attempt to apply a texture image to it - in fact some objects have no UV map at all and show up as 1 color when you apply an image

this script can also turn a standard Daz Studio primitive-plane into a ground plane that can blend in with a given environment sphere ( aka sky-dome ) - in figure 1 there's a 100 ft wide dome and a 100 ft wide ground plane, they have the same ( panoramic ) image applied to their surface - this was rendered in Blender, the Dome actually emits light and serves as the scene's lighting - the ground plane is matte and can receive shadows

lookie.jpg
1920 x 1080 - 295K
Post edited by mCasual on

Comments

  • mCasualmCasual Posts: 4,607
    edited June 2014

    in this example

    we start by loading an environment sphere - which is a gigantic sphere with a special panoramic photo applied to its surface

    we create and position a primitive-cylinder

    we select the cylinder

    we run the mcjSphericalUV script

    and 1 second later it's ready

    we load 2 copies of the cylinder

    and appply the same image as the environment sphere

    and tada we got palm trees!

    kapow.jpg
    1920 x 1080 - 1M
    palmoil.jpg
    1920 x 1200 - 890K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited June 2014

    this time we are "in" a google streetview environment
    in Utah, possibly at the Daz inc building!

    we create a cube 15x15x15 divisions ( if it was 1x1x1 divisions we'd get distortion probably )

    and we project the UVs

    uta4.jpg
    1150 x 656 - 131K
    uta2.jpg
    1154 x 656 - 150K
    uta1.jpg
    1148 x 660 - 212K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited June 2014

    a few notes

    the environment sphere is very large and centered at 0,0,0

    ( which corresponds to how the script sees the spherical image )

    i zeroed the specular strength and made the ambient color white 100% ( 50% for software renders )

    google streeviewt cameras are on a tripod on a car roof,about 8 ft above ground - around 240 cm

    so i placed the ground plane at y = -240

    the daz studio camera is at 0, 0, 0

    ------------

    in blender, i made the sphere emissive and i made it NOT cast shadows

    i removed gloss from the ground plane (shadow catcher )

    at first the plane was visibly darker than the image on the sphere

    i added a Sun-light of strength 3, changed its size to .01 to make sharper shadows

    rotated it until the shadows were positionned like the rest of the scene and so that the ground plane blended with the rest

    sisis.jpg
    1920 x 1080 - 228K
    credible.jpg
    1146 x 656 - 248K
    Post edited by mCasual on
  • Aave NainenAave Nainen Posts: 1,108
    edited December 1969

    This looks interesting......gotta keep track of this thread.

  • mCasualmCasual Posts: 4,607
    edited June 2014

    in this case the spherical UV mapping was transfered to a 16x16m cube
    as long as the camera stays where it is we keep the illusion

    figure 2
    this is one of faces of the cube
    one could use this image to texture a plane
    and the big advantage is that the texture is not all warped and hard to modify

    Figure 3 this is the spherical map from streetview
    editing the brickwalls in Photoshop would be harder than
    editing the cube face images

    small.jpg
    1280 x 595 - 444K
    cubeface.jpg
    1920 x 1080 - 515K
    inthiscase.jpg
    1920 x 1080 - 834K
    Post edited by mCasual on
  • MilosGulanMilosGulan Posts: 1,958
    edited December 1969

    Very interesting, hope i will be able to use it :)

  • mCasualmCasual Posts: 4,607
    edited June 2014

    just now i posted a version of the script

    for Daz Studio 1 and 2

    and one for Daz Studio 3 and 4

    https://sites.google.com/site/mcasualsdazscripts4/mcjsphericaluv


    ( in fact its the same exact code )


    the version for Daz Studio 4.5 and up will be posted soon, as in, say, 1 day


    the manual will also be improved ( i'll include the examples shown on this page )

    my videos featuring things spherically- UV mapped
    https://www.youtube.com/watch?v=ud_bwuNRXg0
    https://www.youtube.com/watch?v=NQs9ht31tuE

    checkeredFilleInACreatedReality.jpg
    1920 x 1200 - 269K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited June 2014

    the version for DS4.5+ is aaaaaaalmost ready ! i think
    got to test it with figures and figure parts


    in Figure 2 - i placed the camera in the center of A3's hips, selected the whole short pants figure
    and a few seconds later i had a copy of the pants with brand new easy to texture UV map

    in fig 3 the UV map for the same pants but zero-posed

    in fig 4 testing the ability to process only selected body parts, in this case Aiko3's hip and buttocks

    fig 5 re-UV mapping only the surfaces with the selected material named "SkinHead"
    note that this takes longer because the script reviews all of Aiko2's geometry looking for surfaces with that material

    geadnow.jpg
    732 x 716 - 261K
    everbeenintheservicemnotreally.jpg
    1920 x 896 - 741K
    mapit.jpg
    704 x 702 - 215K
    whole.jpg
    910 x 910 - 420K
    dsds.jpg
    824 x 743 - 255K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    now available for Daz Studio 1, 2, 3, 4.0 and 4.5+

    https://sites.google.com/site/mcasualsdazscripts4/mcjsphericaluv

    mcjSphPromo.jpg
    933 x 299 - 192K
  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    THANKS so so much Casual. This is one script I'm going to use very very soon! YAY!

  • RAMWolffRAMWolff Posts: 10,212
    edited December 1969

    Wanted to ask. IF I were to use my Sphere Environ in a morphed state, like using one of the many land mass morphs I made for the ground plane would it help eliminate stretching or would it just read the default layout somehow and give me a flattened UV?

    Thanks sir! I'm guessing your a sir.... :red:

    SphereEnviron-Land-01-HiDef.jpg
    1025 x 914 - 286K
  • mCasualmCasual Posts: 4,607
    edited June 2014

    example of a Digital Elevation Map from NASA
    http://ava.jpl.nasa.gov/gdem.php?id=0201-32-

    fig 2 - this D.E.M. used on the displacement channel of a 1x1 plane ( Daz Studio Software render )

    fig 3 the D.E.M. converted into a morph of a 100 x 100 plane - using mcjElevate https://sites.google.com/site/mcasualsdazscripts/mcjelevate ( Daz Studio hardware render )

    fig 4 subdivided ( Daz Studio hardware render )

    mountainamy.jpg
    1920 x 1080 - 1M
    elevator.jpg
    1920 x 1080 - 2M
    thatmap.jpg
    1920 x 1080 - 725K
    N05_E035_ELEVATION_GRAY.jpg
    2000 x 2000 - 789K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    RAMWolff said:
    Wanted to ask. IF I were to use my Sphere Environ in a morphed state, like using one of the many land mass morphs I made for the ground plane would it help eliminate stretching or would it just read the default layout somehow and give me a flattened UV?

    Thanks sir! I'm guessing your a sir.... :red:

    the script projects the UVs on the positionned / scaled / rotated / morphed object

    so if you have a panoramic image which was taken from the point of view of someone at the bottom of a valley

    then ideally you’d project it on a ground plane shaped like that valley

    also it’s better to have geometry with many facets to reduce visibility of stretching

    the USGS has free DEM or Digital Elevation Maps ( well they had them 10 years ago )

    http://ned.usgs.gov/

    it’s gray scaled satellite images where the gray values are proportional to the altitude -

    using a 100x100 plane and my mcjElevate script https://www.youtube.com/watch?v=6dP8faP3KMo

    you could make terrains

    ——

    you could also obtain that result by applying the USGS DEM to the displacement ( or bump ) channel of the 1x1 plane surface

Sign In or Register to comment.