Ivica Drazic
engineer | Cg Artist | programmer
 
Home Artwork Structures Low poly Walkthroughs Android Games Tutorials Shops Electronics Contact
 
V-Ray Studio Lighting


In this tutorial I will show you the method of studio lighting. For rendering I used 3ds Max 7 and Vray 1.47.

First step is to build environment. Place a plane under the model, convert it to editable poly, pull back edges up while pressing the shift button, create a shape around the model like in the picture. After that, use Turbosmooth modifier with 2 iterations on the plane. Assign white VRayMtl to it (Diffuse RGB: 255/255/255).

We'll use 3 vray lights with different intensity, position and color.
Left light: Color-white, Intensity->Multiplier-6.0
Right light: Color-orange (RGB: 255/180/80), Intensity->Multiplier-4.0 (copy the left light, mirror it, move and change intensity and color)
Top light: Color-white, Intensity->Multiplier-12.0. Uncheck the "Affect Specular" slot, we don't want any specular reflection from that light, only diffuse light.

Create the Target Camera from top view with 35mm lens, and set it up as you see in picture. Change Perspective to Camera view and turn on the "Safe Frame" option.


Assign V-Ray as your renderer. Let's do settings.



Short explanations:
Default lights: turn it off, we want only vray lights.
Adaptive QMC: A faster image sampling method than Adaptive subdivision. Set the Adaptive QMC min. subdivisions to 2. Now thinner lines can be rendered correctly.
At the QMC Sampler use value 0,005 for noise treshold. Set the Global subdivs multiplier to 4, it will increase samling quality everywhere in the scene.
Mitchell-Netravali: With this antialiasing filter edges will be sharp but not crisp.
Irradiance map + Light cache: the mostly used GI combination.
Show calc phase: The rendering process will be visualized, so if are not happy with the effect you don't have to wait until the effective rendering.
Subdivision: The subdivision of light cache controls the number of traced paths. The actual number of traced paths is the square of the adjusted number. So with 1200 subdivisions, 1 440 000 paths will be traced. Change the Sample size to 0.006, now small details will be more visible. Use value 1000 to Pre-filter option to reduce noise. Check the "Use light cache for glossi rays" option, it will speed up rendering. For Filter use the "None" option.
Exponential: With this type of color mapping, colors will be saturated so you can avoid burnouts on the surfaces.
Dark multiplier: This controls the "Sternth" or the multiplier of dark colors.
Render region division: set it to 32x32, smaller bucket size - less ram will needed and faster feedback can be achieved.


Change all vray lights subdivisons to 15 or 20 to avoid noisy parts.
Change all materials subdivisions to 20 in their Reflection section. With these settings the render time will increase a lot. Let's render.



Not much noise, artifacts or any other rendering trouble. Picture can go to post production. Because of saturated colors of the exponential color mapping type, we need to add more character to colors and play with the color balance and levels to achieve better contrast. That's it!


Signing Android applications


1. private key
You must generate one using Keytool located in Java bin folder. In my case C:\Program Files\Java\jdk1.7.0_51\bin
JSE is not enough, download JDK from Java web site.
Run -> cmd, navigate Command prompt to our JDK\bin folder (cd C:\Program Files\Java\jdk1.7.0_51\bin) and type:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
in my case:
keytool -genkey -v -keystore stnicholas.keystore -alias stnicholas -keyalg RSA -keysize 2048 -validity 10000
Running the command above, Keytool prompts you to provide passwords and other data. It then generates the keystore as a file called my-release-key.keystore, stnicholas.keystore in my case.


2. compile the application
In order to release your application to users, you must compile it in release mode. In release mode, the compiled application is not signed by default and you will need to sign it with your private key from above.
From Unity:

Use your private key and leave application Unsigned.


3. modify .apk file
Rename your .apk file to .zip or open it with 7zip or similar software.
Remove META-INF folder, make other changes you need, for example place drawable-xhdpi,hdpi,mdpi,ldpi in res folder. Rename it back to .apk if Zip is used.


4. Signing
Use Jarsigner tool located in Java bin folder. In my case C:\Program Files\Java\jdk1.7.0_51\bin
Place your .keystore and .apk file to folder.
Run -> cmd, navigate Command prompt to our JDK\bin folder and type:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
in my case:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore stnicholas.keystore StNicholas.apk stnicholas

Jarsigner prompts you to provide passwords, it then modifies the .apk, meaning the APK is now signed.
To verify that your APK is signed, type this:
jarsigner -verify my_application.apk
If the package is signed properly, Jarsigner prints "jar verified".


5. align .apk
Run zipalign on signed application package. This tool is provided with the Android SDK, inside the tools/ directory. In my case C:\adt-bundle-windows-x86\sdk\tools
Zipalign provides a performance optimization for Android system.
Place your .apk file to folder sdk\tools and rename it. In my case from StNicholas.apk to StNicholas2.apk
Run -> cmd, navigate Command prompt to our tools folder and type:
zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
in my case:
zipalign -v 4 StNicholas2.apk StNicholas.apk
That's it. your_project_name.apk, or in my case StNicholas.apk, is your signed Android application.

Decompile Android applications


Beside Android SDK and Eclipse, you'll need Android APK Tool, dex2jar file converter and JD-GUI decompiler.

1. unpack .apk file with APK Tool. We got folder with resources and AndroidManifest.xml but also .smali files instead of java files. Save this folder for later.

2. rebuilt .apk file

3. convert Android Dalvik executables from .apk file into normal Java jar files with dex2jar.

4. run JD-GUI which decompiles jar files into java source files.

Click "Save All Sources" to save a zip file with Java code.

5. Unzip that file and move it into your project directory. Join resources, AndroidManifest.xml and rest from step 1. Now you have both the .smali and Java sources in your project directory.

6. open Eclipse, create a new Android Project, choose "create project from existing source" and select your decompiled project directory.
Now you can fix up project. Your res, assets, and AndroidManifest.xml are all there, .src source code need to be sort out.
Don't delete R.java file. Place it somewhere outside of your project so you can reference it as you fix up your code. It easier to figure out how to reference R. whatever identifiers in your project.
Example .java file:

protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
addOptionsFromResource(2367443109);
}

You’ll want to change addOptionsFromResource to use an R.identifier instead of a numeric constant.
From R.class:

public class xml
{
public static options = 2367443109;
}

Fix .java code to reference that identifier by name instead of generated numeric value:

addOptionsFromResource(R.xml.options);

Other tweaks: methods that take booleans will have values of 1 or 0, you need to make those true or false. Anonymous functions in the form of Runnable classes will appear expanded to while (True) loops and that looks truly bad.

ATI Radeon -> ATI FireGL (softmod)


By using this tutorial you can modify FireGL drivers in such way that they will install on a Radeon card. That trick, because of different OpenGL driver, gives you extra performance in professional OpenGL applications (Maya and some other CAD apps). Basicly, we will turn our desktop graphic card to workstation one. They share same hardware with different device ID and, of course, different price tag.
This tutorial is only for Windows.
You can't damage your card with this. The worst thing that can happen is driver reinstallation, but if you use the procedure here with the exact same files all should work fine. If you're using WinXP it's possible to roll back to previous drivers. Just open up your device manager, open the property page for graphic card and click on "Roll back driver".


1. Software
ATI FireGL 8.083 driver (http://www2.ati.com/drivers/firegl/firegl-unified-8.083.exe). This version is tested in work with Riva Tuner 2.0 RC 15.4. Other versions maybe wouldn't work with this version of SoftFireGL patch script.
RivaTuner 2.0 RC 15.4 (http://downloads.guru3d.com/download.php?det=163).
WinRAR, WinZip or something similar


2. Modifying the drivers
Once you have the driver downloaded, unpack it somewhere (right-click and select Extract Files...).
Install RivaTuner.
Go to directory where you installed RivaTuner ...\PatchScripts\ATI\SoftFireGL\Unified\ and run the SoftFireGL w2k.rts script (double click). Maybe you will need to run and close RivaTuner first.
Select the FireGL card you want to modify the driver for (It has to be a workstation equivalent of your radeon!). Since my Radeon 9550 is basicly an underclocked 9600 (RV350 or RV360 chip), I will modify drivers for the FireGL T2 capabilities.

Radeon 9500 NP = FireGL Z1 (NP - Non Pro)
Radeon 9600 = FireGL T2
Radeon 9500 Pro, Radeon 9700 = FireGL X1
Radeon 9800 = FireGL X2
Radeon 9800SE = FireGL X2 (4-pipeline mode)
Radeon X800 = FireGL X3

and click Continue.
The script will prompt you for location of ati2mtag.sys file, change the file type to ati2mtag.sy_ and browse to location of your unpacked drivers ...\Driver\2KXP_INF\B_19827\ati2mtag.sy_ (select the file and click Open).
A window will appear waring you that the file is not certified to work with this script, click OK and after a while you should see another window that says: "Patch script has been successfully executed. Read log for details". If there is something else here then patch has failed and there is a very good chance that the mod will not work).

Now you need to manually modify the drivers .ini files with your cards device ID.
First you need to know what your cards PCI device ID is. Launch RivaTuner, in the Main tab you should see a line like this:

"64-bit RV350 with 128MB DDR memory Customize..."
(of course yours will be most likely different).

Click on the little button next to "Customize" and select "Graphics subsystem diagnostic report" (4th icon from the left). Scroll down to "Display adapter information" and right under that there should be a line Device ID : xxxx. Copy that number (xxxx) or write it down somewhere.

Go to location of your unpacked drivers ...\Driver\2KXP_INF\ and open in Notepad:

C2_19953.inf if you are on Windows 2000
CX_19953.inf if you are on Windows XP/2003

You can modify both if you want.
Inside those files you should see a section [ATI.Mfg.NTx86] with adapters listed. Once again, remember for which card you are moding your drivers (in my case it was Radeon 9600 = FireGL T2) and modify only the appropriate lines.
Find the FireGL that you want to mod your radeon into and modify it's Device ID with your cards Device ID.
Be aware that normal and Secondary adapter device ID's usually differ in third digit. Change only the digit that is different between your device ID and FireGL device ID in both lines of the .inf file.

Original file in my case:

(....)
"ATI FireGL T2" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4154
"ATI FireGL T2 Secondary" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4174
(....)


Moded file :

(....)
"ATI FireGL T2" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4153
"ATI FireGL T2 Secondary" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4173
(....)

Adding custom screen resolutions to your FireGL driver:

Locate the [ati2mtag_XXXXXX_SoftwareDeviceSettings] section for your card, where XXXXXX is of course your cards chip name. You can find out what that is from the lines you edited earlier:

In my case:

"ATI FireGL T2" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4153
"ATI FireGL T2 Secondary" = ati2mtag_RV350GL, PCI\VEN_1002&DEV_4173

So the section I need to find is [ati2mtag_RV350GL_SoftwareDeviceSettings]

In that section find a line that begins like this: HKR,, DALNonStandardModesBCD2, %REG_BINARY%,17,92,13,44, (.....)

Add ,xx,xx,yy,yy,00,00,00,rr at the end of that line where:

xx,xx - your screen width
yy,yy - your screen height
rr - your desired refresh rate

For example if you want to add 1280x960@75Hz then you need to add:
,12,80,09,60,00,00,00,75

Save the file(s).


3. Installing modified drivers
Don't use installer, instead update your drivers from the Device Manager.
Go to Start -> Control Panel -> System, select Hardware tab and click on Device Manager.
Under Display Adapters select your Radeon card, right click and select Update Driver.
Select "Install from a list or specific location (Advanced)", click Next, select "Don't search. I will choose the driver to install". Click Next, select Have Disk and point to one of the files you just modified in the directory where you unpacked your driver:

C2_19953.inf if you are on Windows 2000
CX_19953.inf if you are on Windows XP/2003

Click OK and the driver should install. If it complains about lack of driver certificates just click "Install anyway". Reboot the system.

4. FireGL control panel
Now that you have your drivers installed and working you can install the Control Panel that came with FireGL drivers. There is no need to modify anything, just go to location of your unpacked drivers ...\CPanel and run Setup.exe.

After installation reboot your system. If all went well you should have a working FireGL drivers and instead of Catalyst panel a FireGL one, where you can select different application profiles.

Freelance tests

Freelancer Orientation

Employer Orientation

US English - Level 1

HTML - Level 1

WordPress

3dsMax - Level 1

Android - Level 1
Website Contents & Design Copyright © 2025, Ivica Drazic. All rights reserved.