TEXTURING SDS OBJECTS - the easier way  

Author : Garry Curtis
March17 2008 .

A tutorial for Realsoft3D V6  

         Another tutorial in the "Saved From The Abyss" Series . That is , valuable information that has previously passed through the Realsoft mailing list ... straight into the void .

Skill Level Suggested :  

This Tutorial was actually created with the 3D beginner in mind .


Apologies for another long winded tutorial . It's a beginner tute , and so has a tendency to go very slow as well . As extended as it is , it actually only cover's a narrow range of basic usages , delve's into the most basic of 'UV Mapping' options available (and so avoids the 'Map2Object' tool) . Tends to hover on the basic SDS concept as well . Intended to leave the newcomer with a sense for some of the UV Mapping options , with the emphasis on the easy-to-use 'UV-Image' tool , finally by tutorial's end . A single-page tute . Hopefully the index will assist in navigation .

PART 1      -  Basics Of SDS Objects
PART 2      -  Introducing UV Mapping
PART 3      -  Simple UV Mapping Exercise
PART 4      -  Introducing The UV Editor
PART 5      -  Working With The UV Editor  -   4 Simple Exercises

PART 6      -  The UV-image Tool  -   What Works And What Does Not


First  -  Let's Talk About SDS 3D Objects  

OK , let's establish an understanding of terminologies and basic concepts . The common term "SDS" is not at first glance indicative of it's clinical dual nature , of course . The object on the left in image below shows the normally Invisible 'Control Cage' of a typical SDS object , and on the right the resulting nurbs smoothed , 'Subdivided Surfaces' mesh object .

The highlighted feature on the left is an SDS 'Control Polygon' . The Polygon is actually comprised of one single Control Polygon 'Face' , Control Polygon 'Points' (Yellow) , and also Control Polygon 'Edges' (Red) . 14 such Polygon's contribute to create the shape of the resulting smoothed mesh object on the right .

Click Here For An External Link To A Brief Tech Explanation

Important are the Control Cage's 'FACE/POINTS/EDGES' attributes . Each control polygon can vary these attributes , thus many different 'Shaping' effects can be applied to the smoother sub-object . Each and every single solitary polygon can exude very specific "forces" , depending on attributes such as 'Sharpness' and/or 'Roundness' amounts . Multiple forces originating from multiple Control Polygons can combine to affect and to shape the sub object's mesh in a particular area .

Each and every 'Seam' and each and every 'Point' on each and every 'Face' can have a very strong force affecting the mesh in that very specific area . Also , the repeated process of dividing single polygons , over and over , could possibly result in the production of , literally , millions of Control Polygons , each one having the Potential for a full set of Multiple Control Attributes , realized or not .

Millions Of Polygons ?  

Typically speaking though , a user will start with a basic SDS shape and modify certain areas of that shape . For instance , start with a sphere and slowly modify 'Points and Seams and Faces' as the process of building (for example) a human head , progresses . Certainly , "millions" of control 'Points' will not usually be required here . Thousands , perhaps , depending on the level of detail required .

Also , when required , the 'Level of Detail' can be confined/focused on specific areas with hundreds of polygons , (lips & eyes) while the rest of the SDS model can remain relatively close to the original mesh's default resolution .

Subdivided Mesh Rendering Modes

Activate 'OpenGL' rendering and create a nice smooth , SDS Sphere . Hit the 'Space Bar' to enter 'Edit Mode' . Observe the 'Control Polygon Cage' that appears . Notice it's a very "Course" mesh . Now , 'double left-click' on the SDS Sphere in the 'Select Window' to launch the 'Properties Window' for your Sphere object .

Select the 'Spec' (short for "Special") Tab in the 'Properties Window' and you may be slightly overwhelmed by all the many things presented here that pertain to the default qualities of this SDS Sphere object . For now , we will concentrate on changing one little thing to help this visualizing exercise .

Still in the 'Spec' Tab , go down to the 'Rendering Section' and you'll notice that the "drop-down box" is set for 'Smoothen To Nurbs' . Change it to 'Polygonal' while you watch the Sphere in the 'View Window' . Notice how the Sphere very abruptly changed ?

Mixing and Matching  

I'm sure you have already assumed that we can also "mix and match" our SDS Control Polygon's forces within any object . Have a smooth , nurbs-like top and also have a rough looking bottom . This is the beauty of SDS . We can really define exactly the look for any specific area . A nice smooth blending , or a sharp , sudden corner , or knife edge .

Also very cool is the fact that we can apply deformation tools to the Control Polygon Mesh using any of the dozens of tools . Apply transformations to the Whole Object , or to a single group of Polygons . Either way , the 'UV Coordinates' were designed to always maintain their relationship , and so the texture will change right along with the modified 3D mesh , and also in a reasonably predictable manner . "UV Coordinates ?" (You Ask)


The UV Coordinate System  

The term "UV" is kind of a substitute for the familiar and very logical 3D coordinate system's "XYZ" . However , since a UV mesh does not actually exist in the 3D world , a 2D term (like XY) is fine . Visualize the UV's as a kind of invisible , very stretchy , wrapping paper that covers a 3D object . "UV" is unique , and when we hear the term "UV" mentioned , we automatically know 'Texturing' is the subject .

In Realsoft3D Default SDS objects (cube/sphere/cone/etc) are created and drawn on screen without the low density 'Control Cage' visible . We may not need to reshape these default objects so the cage is kept hidden for simplicity . 'Space Bar' places us in 'Edit Mode' and now we can see the wireframe representation of the 'Control Cage' .

This is a vital fact to keep in mind when texturing . Even though we cannot see the 'Control Polygon Faces' by default , we do have to know how to activate them . The RS 'UV' Coordinate System actually pertain's to the subdivided mesh . However , 'Face Mapping' of the subdivided mesh will be "done through" the lower density Control Polygon's Faces .

Equally important to realize is that mapping textures the traditional way  (parallel/spherical/disk/etc)  will "By-Pass" Control Polygons and be applied DIRECTLY ONTO the subdivided mesh via a 'Mapping Primitive' assigned to the 'Level Object' the subdivided mesh is residing in .

If this sounds confusing , it's only because it is . Also confusing for the newcomer , RS3D provides multiple 'UV' Mapping options for SDS objects , from traditional and simple methods , to more advanced methods for more advanced users . Understanding all these tools and how best to use them may take some time .

Additionally , we have many possible texturing scenarios . For instance , to 'UV Map' a 'Procedural Bump' Texture , we could go into 'Edit Mode' , quickly drop a procedural bump texture onto certain Faces , render and if it looks great , leave it and move on.

If however , we were to quickly drop a photograph onto those same 'Faces' we would not be happy with the resulting render, which would have to be manipulated in the RS3D 'UV Editor' . In the UV Editor we would adjust the Texture's 'UV Coordinates' in order to get a better fit .   - See    PART 4   &   PART 5 

Why UV Mapping ?   

Why 'UV Map' a texture ? Well , we don't actually have to UV map it , if the SDS object is not going to be involved in posings , or animations that may distort the mesh . Or if the mesh is fairly consistent in places that can be mapped easily using parallel , disk , cubic (etc) type mapping objects .

As you know , parallel mappings may not look realistic on curved surfaces . With UV Mapping tools we can tweak the UV Mapping 'Points' and 'Faces' to stretch or compress the texture in areas of the SDS mesh where , for instance , a Spherical mapping exhibit's flaws or "stretching artifacts" from not conforming to the SDS mesh because of varying curvatures .

Most importantly , integrating the mapping "into the mesh" , as opposed to "onto the mesh" will allow the texture to grow , move and mimic the mesh's deformations . For certain situations you will want to integrate the texture so that the mesh does not slide around "under" the texture mapping object .

Keep in mind , UV Mapping is best left for the final stage , after the modeling is finished . Applying a UV Map and then shaping the SDS mesh can result in the stretching artifacts previously mentioned . Then again , if the object is a rubber balloon , or a tattoo on a human muscle , we will want the texture to stretch with the subdivided mesh .


Is UV Mapping Hard To Do ?  

Yes and no . It can be a very easy way of simply adding textures to certain areas of a 3D object . It's perhaps harder to understand the 'UV' coordinate system , than it is to do a simple 'Face Mapping' .

The whole UV concept can be a bit of a bear to wrap your head around at first . Simple mapping tasks can be very straight forward . Advanced Texturing Tasks may take some "decision-making" to get the final texture to look correct , with the least amount of effort .

Believe it or not , personal backgrounds can be a stumbling block . We may be used to working with Analytic objects and seeing how one surface is directly related to another surface ... how each pixel of a texture is directly related to neighbouring pixels on those surfaces . This is not always so in the world of SDS .

For instance , the UV Coordinate Mesh tends to converge to a single point at the poles of SDS Sphere objects , possibly distorting any default mappings applied . Workarounds are required to avoid or correct these artifactings .

Try It !  Here's How :    

Activate  the 'OpenGL' Rendering Mode .
Choose  a 'Side-View' .
Create  and select an SDS Sphere .
Select  a 'Top View' .
Left-Mouse-Drag Select  an outer area of the Sphere object .
Right-Mouse-Drag  to have the 'Compass-Menu' appear .
Select  'Edit-Faces' Mode .
Switch  to the 'Materials' Tab in the 'Select Window' .
Drag  the 'Circles' Material into the 'View Window' .

Render , and we see those selected Faces have now accepted the material directly "into" the mesh . If we look at the SDS object we will not see it and a 'Mapping Object' sitting in their own Level .

If we open the SDS 'Face Mapped' Object's Property Window , hit the 'Spec' Tab , and view the 'Faces' Control Panel we will see the Texture listed there . Render , and if we're not happy with the mapping or the texture , we can "Right Click" and perhaps select another texture , or simply select 'Detach' and the texture will be removed completely , so that we can select another set of Faces , or maybe do a 'Smooth' operation to the SDS mesh and select a more compact area for texturing ...

'Circles' Texture Is Indictated As Being Face Mapped


Time To Roll Up Our Sleaves and Open The UV Editor  

Open the 'UV Editor' window (Main Menu/Windows/UV Editor) . There , you will see a rather odd looking mesh , of sorts , layed out . This mesh obviously pertains , somehow , to the SDS Sphere . This an attempt at showing a 2D representation of a '3D' mesh (not an easy task) . You are looking at the default 'UV' layout for all the 'Faces' of our SDS Sphere . You are looking at the 'UV Coordinates' for this Sphere .

Now , before you draw any conclusions , let me first tell you that "what you see is _Not_ what you get" . Obviously , the mesh in the 'UV Editor' is _Not_ a representation of the Sphere's high-density subdivided mesh . No , it is also _Not_ a direct representation of the Sphere's Control Cage mesh .

You are looking at the 'UV' Coordinates mesh that   is in-directly related  to the Control Cage mesh of the Sphere . However , each 2D shape in the 'UV Editor' is actually a representation of a certain and specific set of 3D coordinates on the Subdivided Mesh .

Now , before you get frustrated with this concept , let me say that it is not an easy thing to deal with at first , so don't despair . In fact , it may only take a few attempts at actually working with 'UV Mapping' to get a good feel for it . If you _Have_ previously grasped this , you have grasped the basic UV Mapping "Duality" concept (congrads!) . Let's do a couple of things to help visualise what we are actually dealing with .

Comparing Apples and Oranges  

1)  Switch your 'View' Window to 'Wireframe Mode' and have a look at the dense , 'Subdivided' mesh of the Sphere .

2)  Select 'Face-Edit Mode' for the Sphere (SDS Tool Window/Contol Bar/Edit/Face)

We see the low-density 'Polygonal Control Cage' mesh appear    (just hit the 'Space Bar' to exit/enter 'Edit Mode') .

Important Stuff To Follow  

3)  With your mouse , click on a spot on your SDS Sphere . You'll notice 2 things .

A)  The "area" selected is highlighted . This "area" is an SDS Control Polygon 'Face' .
B)  The highlighted Polygon seem's to correlate to a highlighted area on the mesh in the 'UV Editor' .

I know it looks very straight-forward at this point . You've selected a Squarish Control Cage Face , and this activated a Square in the UV Editor . However , this seemingly obvious 1:1 relationship , is actually not quite this basic . Many times the SDS Face's shape will not match the shape in the Editor .

Sometimes the Face in the Editor can be partially hidden , or even appear as just a straight 'Line' .RS3D does try to create a reasonable representation , but sometimes cannot . This is where the 'Map2Object' and 'UV-Set' tools can greatly simplify the UV Mapping process . More about that later . For now , let's just keep slowly working away with some simple examples .


Let's Try Working With the UV Editor  

Actually , we'll begin by doing a very simple Color Mapping . The UV Editor will not be required for this type of Color Mapping , so we might as well leave it closed for now .

Exercise A  -  Color A Face

1) Start fresh .  Close and re-open Realsoft3D .
2) Make sure  OpenGL rendering is activated .
3) Create an  SDS Sphere . Leave all settings at default .
4) Select the  Sphere . Dbl click it and choose the 'Wire' Tab in the 'Properties Window' .
5) Change the  Texture Quality to a higher one - '512' using the drop-down box control .
6) Change to  'Face Edit Mode'      Face Edit Mode Instructions  .
7) Select a  Face on the Sphere .
8) On the  'Spec' Tab select the hidden 'Color' Attribute and choose a color .
9) Notice the  Color spills over into neighboring Faces . Render to confirm the OpenGL .

Exercise B  -  Face Map a Texture

1) Repeat  steps 1 - 7 , making sure a single Face is selected again .
2) Choose  the 'Materials' Tab in the 'Select' Window .
3) Select  the 'Checkers' material and drag it into the 'View' Window   (drag&drop)  .

4) Notice that the material is not mapped as you might have anticipated . Render to confirm .
5) Open  the 'UV Editor' Window .
6) Notice  the Editor provides no feedback on Mapping , except for which Face is chosen .
7) In the UV  Editor Right-Click - from the menu select the 'Checkers' Face Mapped Material  (Below)  .

  8) In the UV  Editor Window we can easily see why the Face Mapping is not satisfactory .

  9) We are in  'Face Edit Mode' so grab the Face and drag it to the intersection . Render .

10)  Notice !   -you moved a 'Face' but the actual SDS Mesh did not move ... only the Face's UV's moved .

Exercise C  -  Modify A Face Mapped Texture

1) We'll pick up here immediately after Step - 9   (Directly Above) 
2) In the UV Editor select 'Point Edit' Mode .
3) Zoom out . ( Shift-Right-Hold )

4) Select each of the 4 individual points and drag them far beyond the 'Checker' material .
5) Notice the repeating ( 'Tiled' ) pattern we've applied to our selected Face .

Exercise D  -  Modify Multi-Face Mapped Textures

1) Same as above , but this time select more than 1 Face to Drag&Drop the 'Checkers' Material to .
2) Multi-select the Faces , in the Editor zoom-out and re-scale the Faces (s-key).

3) Enter Point-Edit Mode and drag a Face's Points around to distort the 'Checkers' Material .
4) In Face or Point-Edit Mode , select and perform a 'Rotate' Transformation (r-key) .

5) Keep in mind that all these transforms can be recorded and animated too .

6) Switch to UV Coords-Mode and notice again that this mode offers no visual feedback about the material transforms .

Let's Do A Quick Re-Cap  

Before we move on to the next and final part , let's do a quick re-cap . We learned that SDS control polygons are related to the underlying nurbs-smoothed mesh , and that Control Faces are related to the smoothed mesh's 'UV's too . We learned how to add textures and color and how to manipulate the points and faces of those UV's .

However , there are several tutorials worth of UV Mapping information that will not be covered here . I would suggest having a look in the manual at the tutorials pertaining to UV Mapping and SDS Texturing .

Many Options And Toolsets For UV Mapping  

Sometimes the automatic 'Unwrapping Process' does not always go so smoothly . RS3D has created tools for helping to get a reasonable layout in the UV Editor . For instance , we have the 'UV Set' Tool to help us get easier UV Coordinates to work with . UV Set can give automatic and custom 'Unwrappings' . The versatile 'Map2Object' Tool is designed to help us unwrap smoother UV Coordinates too .

'Map2Object' Tool is also an optional tool for applying materials directly to particular Selected Faces , or to a whole object . It is a 2 step method , not as simple as the Drag&Drop method , but much more versatile . It even has undocumented usability for advanced users . These tools will , basically , access a parallel map on selected areas to allow for easier UV Mapping and more accesible UV Coordinates . The 'UV Editor' will then be used to finalize the mapping or to work with these Coordinates .

These mentioned tools will take a little bit of practice , if only to discover their limitations . Most RS3D modelers have been using these tools for years and may be found adequate , essential , if not downright powerful . On the other hand , some modelers simply prefer to export their completed SDS meshes for texturing in a commercial 3D Painting application , and then re-import the mesh and the assigned UV Maps .

Looking at all the available UV Mapping tools and then deciding which one you like best is also part of the equation . The odds are that you will end up in the manual first , and eventually in the rather barren 2-dimensional 'UV Editor' , no matter which of these above tools you choose for your current 3D project , until you eventually get a "feel" for what-does-what , best .


Now We  Finally  Get To The 'UV Image' Tool  

The actual purpose of this tutorial is to provide the new user , with the simplest method of all . The 'UV Image Tool' will allow the new users to 'UV Map' using tools many are already familiar with . Traditional mapping methods such as 'Parallel' and 'Spherical' can be easily applied and tweaked in Real-Time OpenGL without any trips into the manual or the 2D UV Editor .

The UV-Image Tool allows us to texture to our hearts content , using all means and manners of texturing and mixing/matching textures like we always have before , without having to pay too much heed to what is going on with our UV Coordinates . When the object texturing is finished the UV Image Tool will calculate the 2D texture for us , and also automatically UV Map it to all the 3D objects we have selected .

It is fast ! It is powerful ! It is extremely easy ! It is almost totally overlooked ! It does not have the advanced options that the 'Map2Object Tool does . It is a much more logical starting point for the newcomer to RS3D , who just wants to simply UV Map a texture to an SDS object .

A Simply Mapped Object  

Load this pre-textured .zip compressed RS3D project file Click Here For The 50KB .ZIP File  . Best that you stick with this provided pre-built project for now , which will make following along much easier .

In high quality OpenGL and Ray Traced Renders you will see a modestly textured SDS sphere . The sphere is default SDS , smoothed once , then the UV's have been initialized (Interface Control Bar/Init-UV) . It has been mapped with 1 spherical texture ('Circles' material) and 1 parallel texture ('Granite' material) .

 STEP  # 1     --    METHOD  A  :   'Direct Mapped'

Select the Sphere only (not the textures too) and locate the 'UV Image' tool at the far left in the 'Main Toolbar/Materials Tab' . Click to activate it , and leave everything at default (just for now) but do change the Drop Down Box from 'Color' , to 'Evaluate' . Click 'Accept' . Now do a render . Yes , it looks like crap , but this is a good starting point for us to explore this new tool and what it does (and maybe why it get's ignored so often) .

What did this tool just do ? Well , according to the manual it has created an image that has been 'Direct Mapped' to the sphere . It does so by taking a look at (Evaluating) the complete SDS mesh , and then sampling the mesh at whatever quality setting we have chosen . Then it creates a .bmp image and 'Direct Map's' it to the Sphere object . Simple .

Take a look at the Sphere's 'Property Window' . We will notice that there is nothing in the 'Faces' panel this time . Nothing has been mapped to the Sphere's Faces in the same manner that we saw in our previous examples ( above in  PART 5  ) . However , RS3D has indeed automatically mapped the textures for us ... .

Select the 'Images Tab' (4th from left in the Select Window) . Now , open the 'UV Editor' . Pause , and we will see this new image the UV Image Tool has created appear along with our familiar 'UV mesh' . Notice that RS3D has simultaneously placed the newly created mapping in the 'Images Tab' , also . This is how RS3D is providing the background image for our 'UV Editor' .

Zoom in a little (shift-hold + right mouse button) and we see mega-pixelation . Notice too that we are in 'UV Coords-Mode' , but if we select a face and move it around , the Sphere's texturing changes too . Same if we modify 'Points' (like we did in the previous exercise in  PART 5 ) . Let's explore the interface and see how mapping with the 'UV Image' Tool is different from our previous experiences with "Drag&Drop" Face-Mapping .

View The Auto-Mapped Image  

Select the 'Col' Tab on the Sphere's 'Property Window' . On the 'Texture Panel' (in the 'Texture Field) we see that RS3D has created the image in a default directory for us . RS automatically linked to it , and automatically 'Direct Mapped' it to the Sphere . Click on the 'Show' button to view the image .

It's not too hard to see now why the resulting render looked so bad . The image is way too small ! (128 x 128 pixels) Especially so , for this size of an SDS Sphere . In a minute we'll go back to the 'UV Image Tool' and adjust-up our sampling qualities for a much better Evaluation .

Return to the 'Col Tab' of our Sphere object , and delete our tiny texture from the 'Texture' selection field by doing a right-click , then a "Select all" , and then perform a right-click/delete" . Now , we're ready to try it again at much higher quality settings .

Pump Up The Quality !

Repeat Step # 1 - Select the Sphere and then the 'UV Image Tool' . This time manually assign a pixel value of 1024 x 1024 . Select 'Evaluate' , and this time let's crank up the 'Sampling' Slider to between 5 and 10 (depending on how fast one of your CPU cores is) . . Please wait a little bit , while keeping an eye on the RS 'Status Window' to see how the image creation is progressing . It will take a bit of time on slower computers .

Render ... and we see a much nicer result . Not perfect yet , but perhaps good enough for our needs . If higher quality is required , increase the pixel resolution and /or the 'Sampling Rate'and try another test render . There is a particular 'Fly in the Ointment' , so to speak .  (see below) 

  Sorry - Still Not Good Enough  

You may have noticed the texture distorting on the front of the Sphere object . This , I'm afraid is one of the problems RS3D has with the default SDS UV Coordinates on Sphere objects . You may remember I mentioned it earlier , and sure enough , it rear's it's ugly head here . Super high image resolutions , with very high sampling rates , will only help , but not cure it . Same with mesh smoothing operations . However , fear not !  Enter the 'Per Face' Mapping Option  .

 STEP  # 1     --    METHOD  B  :   'PER FACE MAPPED'

Repeat Step # 1 - exactly as just above ('Evaluate' at 1024x1024 - 5-10 Samples), but this time , tick the 'Per Face' Check-Box to have RS3D automatically assign the image to the Sphere on a "Per Face" basis , much like we did manually in the simple exercises in  PART 5 . Click Accept . Remember to wait for the results .

Render at 'Reasonable Quality' or better , and we see a decent looking result . You might still notice some artifacting at the sphere's nose , but this can be virtually eliminated via higher pixel resolutions and sampling rates .

Look in the 'Faces Panel' of the Sphere's 'SPEC' Tab . We will see that this image has indeed been attached , just like our exercises in  PART 5 . RS3D has automatically generated a shader and attached it for us . Amazing ! We could even import the image into a paint program and perform simple adjustments there (lighten it or increase saturation) .

Open the 'UV Editor' . The first thing you may notice is that we have a Face Mapped Material there , ready to be selected . Remember that we selected the 'Per Face Option' and that is how the 'UV-Image Tool' has applied the higher sampled texture this time . Select the 'UV Mapped' texture .

Once we are in the proper editing mode we also very quickly see an odd looking hodge-podge of colors . The UV-Image Tool has very exactly converted all the odd shaped SDS Faces into 'UV' squares . It has also Sampled our texturing on a Face-by-Face basis , and present's the image as such .

So then , previously , we may have had unevenly distributed UV Coordinates in the UV Editor , but the Image being applied looked recognizable . With this new method , the Image applied is unrecognizable , but the UV coordinates are very evenly laid out in perfect squares ...

Also , now , RS3D has automatically created a VSL Material Shader . View it on the 'Mat' Tab of the Select Window . This shader is now there for us to manipulate with the built-in Shading Language's various lines of VSL Code and unlimited options .

That's It ! That's All !  

Seemed like a very long tutorial ... and it was . Even so , we have just scratched the surface . There are 'Power Tools' not mentioned , and in fact , the most widely used tool (Map2Object) was not discussed . This tute may help get the new guys started quickly (except for the reading time) .

As the need for more advanced SDS mapping emerges , so will your skill level with RS3D . "Horses For Courses" . No matter which course of action required in the future , the built-in Tools will get you there . In the meantime , this will get you going .

    Cheers , and best of luck with your work . If you need further help , just give a shout out !!