Sunday, September 19, 2021

Protect your sculpt maps with your logo - A Gimp Tutorial

 
 

Hello Folks! 

 
Have you ever wondered how people get their colorful logos on a sculpt texture? 
Besides creating truly unique sculpt textures, it's also an elegant way to promote your brand and protect your precious sculpties from copybotting.  
 
Well, for me, it was always a big mystery and I really wanted to know how people do that. 
Of course you can buy an expensive tool that does this for you. But as I'm notoriously short on money, this was not an option. I had to find out how to do this by hand.
And hey, in fact, it turned out to be super easy! All you need is a graphic program that can handle transparency and layers to do it yourself in a few simple steps. In this tutorial, we will be using Gimp, version 2.10.24. You can download the newest Gimp version for free here: Gimp Download
 
 

So, what do we need? 

1.) A sculpt map

First, you need of course a sculpt texture. In my example, I used a simple single rock sculpty I created with the jasspub plugin for blender 2.4. I know it's old but it's still the best free tool around.

Note: 
Your sculpt map needs to have a resolution of at least 64x64 pixels or your logo will appear very blurry. You can carefully scale them up but I recommend to not scale them beyond 128x128 pixels to keep texture loading times reasonable.  The bigger you make your texture, the longer it will take to load and the more client sided lag it will cause for your customers. A resolution of 64x64 or 128x128 should be fine, even for a more complex logo.  
 

This sculpt map is 64 x 64 pixels in size, so big enough for the logo we're going to use today. 
If the reference pictures of the sculpty and the logo itself are looking a bit blurry in the process, it's because they're very small and in order to work on them, I zoomed very far into them. 
It was debating to use textures with higher resolutions for the blog but I decided against it. I think it's better that you see right away how the real thing looks like. 
No worries, they might look blurry when zoomed in so far but when you see them in their normal size, they'll look fine.
 
Some sculpt maps created with SL inworld tools are having a format that is only a few pixels wide, like 64x8 or something. This ratio can't be changed without distorting the sculpt and unfortunately, it's almost impossible to put a logo on it (believe me, I have tried!). 
In any case, it's advisable to try out your logo version of the sculpt locally to make sure it works well before you finally upload it to Second Life.

2.) A logo
Then you need a logo. Best results you will get from a clear black logo with a transparent background and sharp outlines. It shouldn't have very delicate lines or be too detailed as this could turn out unrecognizable in the outcome. 
In my example, I used a simple black picture on a transparent background I found on pixabay
 
 
The simpler you keep your logo, the smaller you can keep the original sculpt texture. Our example logo would work perfectly fine on a 64x64 sculpt texture. If you include text or other finer structures, you might want to go with 128x128 pixels.
 
This is already all we need - besides Gimp (or any other graphic design program that can handle layers and transparency). 
 
 

Now let's start


Step 1: Prepare your sculpt map


Open the sculpt map in Gimp. 
If your logo picture contains very fine lines or text, you might want to scale it a bit up, but please take into consideration that, the bigger the sculpt map, the more loading time it will need for the viewer. 
Best is to keep it as small as possible. In any case, it should NOT be bigger than 128 x 128 pixels. 
 
Make sure to also keep the ratio of your sculpt map. Changing the ratio will distort and break your sculpty. 
In fact, also just increasing the size without any change of ratio can break the sculpt in some cases, so try and keep the original size of your sculpt map if possible. 
For our Lotus Flower Logo, 64 x 64 pixels are perfectly fine.

 

Step 2: Duplicate the sculpt map layer

 

Make a copy of your sculpt map layer, so that you have 2 of them in the layer stack. 
You can click on the eye-icon beside the top layer in the layer window to make it invisible for now. 


Step 3: Set the lower layer to Opacity = 1.0

 

Select your lower layer and go on the slider on top of the layer window. where it says "Opacity". 
Either use the slider or double click on the number and set the Opacity to 1.0. This will make the sculpt map invisible for the human eye - but the color information of the single pixels is still there.

Note: 
This trick, we can use to protect our sculpt maps which are too small or don't have the right ratio to put a fancy logo on them. In this case, we don't need a second layer but just set the opacity of the sculpt map to 1.0 and export the result. 
Uploaded in Second Life, the sculpt map will appear totally transparent and can not be copybotted. 
Due to the remaining color information, it will still work as a sculpt map though. 
 
After you're done with this step, set the top layer to visible again by clicking the eye icon beside it. 


Step 4: Prepare your logo

 


Open your logo in gimp in a new window. 
If it's bigger than your sculpt map, go to "Image" in the top menu and select "Scale Image". 
Scale it so that it fits into your sculpt map.
In case of our Lotus flower, I kept the ratio of the flower and scaled it to 64 x 50 pixels. 
 

If you like it better, you can also unlink the little chain besides the height and width values to break the ratio and scale it to 64 x 64. The logo will get stretched into the new size of course - which, in this case, is so little that it hardly matters, so just go for what you like best.


Step 5: Copy it into your Sculpt map as a new layer 

 

When you're happy with the size of the logo, go to "Edit" > "Copy" (or CTRL-C) to copy your logo. 
Go back to your sculpt map and create another layer on top of the layer stack (press Button 1. in the picture).
Go to "Edit" > "Paste" (or CTRL-V) to paste your logo into the sculpt map picture. It will be floating over the new Layer.
You can now move it around until you like where it sits.  When you're happy with your layout, anchor the floating selection (press Button 2. in the picture). 

 

Step 6: Cut out the logo in your sculpt map



Logo Layer:
Have your logo layer selected, go to the "Layer" menu and select "Transparency" > "Alpha to Selection". 
This will select all the visible parts of the picture. 
 
Now click the eye icon beside your logo layer to make the logo layer invisible. 
As you can see, it's outlines are still selected. This selection will stay until you change your selection, so it will apply to all layers you're working on. 
At this point, we could actually delete the logo layer entirely. All we needed was the selection from it, not the layer itself.  If you prefer to be on the safe side, you can keep it but make sure it is invisible
If it later appears on our finished sculptmap, it will break the sculpty.
 
Sculpt COPY Layer (middle layer):
Switch to the upper sculpt COPY layer (the middle layer in the layer stack). 
As we don't want a "negative" version of the logo, we need to INVERT the selection to be able to cut out everything that is NOT our logo.  


Go to the top menu and click "Select" > "Invert" (CTRL-I).
This will invert our selection so that everything is selected EXCEPT FOR the logo. 
If the outline of your picture seems to be moving or flickering, your selection is inverted correctly. 
 
Alpha Channel:
Before we now cut out our logo, we have to make sure that our Sculpt Copy layer actually has an alpha channel. An alpha channel allows us to make the texture partially transparent. If a layer doesn't have an alpha channel, it will just make areas without color white instead of transparent. 
 

Go to  the "Layer" menu and select "Transparency". In the new menu right on top, it says "Add Alpha Channel". 
If that is greyed out, you're fine. You already have an alpha channel, so you can just leave that menu. 
If it's available, please click on "Add Alpha Channel" to enable transparency in your sculpt map copy layer. 
 
Finally: Cutting out the logo
After making sure you have an alpha channel on your Sculpt Copy layer, you can cut out your logo. 
Go to "Edit" > "Cut" (CTRL-X).
 
It should look like this now: 
 


 Step 7: Exporting your sculpt map


Now it's time to export your sculpt map, so you're able to use it in Second Life. 
The important thing here is that we have to make sure that BOTH sculpt map layers are set to VISIBLE. 
Even though the lower layer is not visible to the human eye and appears transparent. we still need the color information of those almost transparent pixels, so it HAS to be visible when we export the picture. 
 
The Logo layer (the top layer), however, should NOT be visible. 
Either we delete it to make sure that it doesn't show up on the uploaded picture, or we set it to invisible by closing the eye icon. Both ways work fine. 
 
Exporting: 
Go to "File" > "Export As". 
In the new window, pick the save location, and a name for your new Sculpt map. Make sure to enter the suffix .PNG behind the filename. 
When you're done, press "Export" on the bottom of the window. 
 

Note: 
In Gimp, you can save your files in a lot of different formats. You can determine the file format by typing the according file extension directly after the file name. 

In this case, we need to save it as a .PNG - file as this format supports transparency and also has the capability of saving the color values of transparent pixels - the very feature we relay on for our fancy sculpt map protection trick. 

After we have hit "Export",  we will get a list with options.
You can leave everything on default, but you need to check the box "Save color values from transparent pixels".
This is essential - without this, our trick won't work. 
 

Remember how we set the lower sculpt map layer to 1% Opacity? Even though the layer now appears invisible, the colors are still there. That's also why we had to make sure that this layer is visible on export. 

So with both Sculpt map layers visible, the logo layer either deleted or invisible AND "save color values from transparent pixels" CHECKED, we can hit the "Export" button. 

And here is our fancy new sculpt map, with logo, ready to be uploaded to Second Life! YAY!


Step 8: Uploading to Second Life


Yesyes, I KNOW you know how to upload stuff to Second Life, no worries. 
 
oh... you don't?
Well, it's easy: In your viewer, go to the top menu and select "Build" > "Upload" > "Image".  

There's just one thing that is important when it comes down to uploading sculpt maps though:
You need to check "Use lossless compression" in your upload window.
 
 
When you upload your sculpt map, you will have to pay the upload fee of 10 L$. 
So make sure you try your sculpt maps locally before uploading them, in case the sculpt turns out distorted. This can happen with very complex sculpties. If you don't like the outcome, rework the sculpt map with a simpler logo or just set it to 1% opacity without any logo, that usually fixes it. 
 

But... why does this work??


Well, it's actually fairly simple: 
Sculptmaps use a color code to define a 3D-coordinate. The Cartesian coordinates X, Y, Z get transported into the colors Red, Green, Blue. This way, every pixel has a specified color that tells it's place in space. 

Our sculpt map still has all it's colors all over the map. Parts of it are fully visible (the parts of the logo) while other parts (the parts around the logo) are almost - but not entirely - transparent. They do, however, still "know" their color values. 
The trick is to save these transparent color values during export. The .png - format allows us to save the color values of transparent pixels, so the colors are still saved in the sculpt map, even though they appear transparent to the naked eye. 

Sculpted prims take the color values of a sculpt map and transport them back into local coordinates. They don't check for transparency, just for the color value of each pixel.
 
This is why it is so important to save the color information of transparent pixels on export as a .png file and also why we have to use lossless compression on upload into Second Life. If the color information of the transparent pixels gets lost or compromised, it will break our sculpty. 

That's it! 


I hope you enjoyed this tutorial and I could inspire you to protect your sculpt maps with fancy logos. Please let me know your experiences in the comments, I'd be happy to hear what you make with it. 
Also, if you have further questions or something during the process is unclear, just drop me a line in the comments. I'll be happy to help. 

Have a wonderful time and see you soon,
Wolf Song







No comments:

Post a Comment

Create a Custom Texture for Bought Mesh

  Mesh! What a wonderful and beautiful thing to have! How much detail, how many faces, shadows and SO realistic! We all want it, don't w...