PoseRay is an utility to convert OBJ files exported by Poser4 into POV-Ray code and Moray UDO files. It handles the geometry with the least intervention from the user and it was done with ease of operation in mind.
Note that this program was designed for Poser4 OBJ files only. It was not tested with OBJ files generated by other programs and may or may not work in those cases.
I refer to POV-Ray and MegaPOV interchangeably here. MegaPOV is POV-Ray with extra features (it uses the same base source). PoseRay uses its UV mapping features. UV mapping is now supported in POV-Ray 3.5beta.
Check on the comp.graphics.rendering.raytracing newsgroup for the latest information on the file location. Just search for flyerx or poseray. Google is a good source for reading newsgroups. I will try to keep the latest version posted on povray.binaries.utilities group from the news.povray.org news server. It is an open server so you can easily set up your news reader for it.
Just place the decompressed files anywhere in your system. No installation program needed and no Windows registry entries are used. To uninstall just delete the files. PoseRay was created with Delphi5 and it does not require any external libraries to run. The only files needed are poseray.exe and poserayhelp.htm (this file which is included in the downloadable PoseRay zip file).
- Output: You can change all the output file names in the output tab. PoseRay defaults to the root of the input file and uses the corresponding extensions for each file type. The precision of the POV-Ray file can also be changed here. The default of 6 is used by Poser to export OBJ files. The reason for this option is that with the default value files are as small as possible while containing accurate coordinates of the geometry. But if a model with geometry containing very small and very large values at the same time increasing the precision will include enough digits in the output files for the model to be properly represented. Do not make the precision too low or the model will come out looking like it was made by a cubist sculptor. The last option here is to have a MegaPOV header or not depending on what are you using.
- Materials: The materials tab will allow to change the material highlight and transparency. Poser4 transparency is not transferred to the OBJ file. Also OBJ files exported by Poser4 do not contain any bump map information (This may be a limitation of the OBJ specification). You can select the bump map image (PNG format) for every material. The bump size of 0.5 should be enough for most purposes. Enlarge this value if you find that the resulting bump is not strong enough. POV-Ray does not support the coloring of textures like in Poser4.
Transparent textures are covered in the tips section of this file. Make sure that if a material is going to have a texture with transparency the material transparency in PoseRay should be 0% unlike what Poser needs. You can also assign textures to the material in this tab. POV-Ray now supports JPEG and TIFF among others so they can be used without conversion. For some reason POV-Ray has problems with some texture files. Try to resave them or convert them to another format.
There is a way of having a colored texture by adding an extra texture for the desired material in the materials file (*_mat.inc) that PoseRay exports. Adding a pigment before the image map with the desired color and then making the image map filter 50% all colors should work. I may add that feature to PoseRay later so this is automatic.
- Geometry: The geometry tab allows you to change the scaling and position of the entire geometry in POV-Ray. PoseRay by default scales all geometry by 10 since the Poser4 scale is rather small while working on POV-Ray. You can also include a small XYZ axis of size 1 at the origin. It may be handy in positioning items in POV-Ray. You can also add a floor, a sky and up to 3 lights. The geometry tab also allows the resulting POV-Ray geometry to have the surface made up of smooth triangles or flat triangles. This may be useful on models where sharp edges are needed such as a sword. With smooth normals the blade will look dull and the flat sides will have a rounded look. Using flat triangles will give it a very defined and sharp edge and surface. UV mapping will be applied properly for smooth or flat triangles.
- Moray: The Moray tab is used to determine if you want a simple box to represent the model in the UDO Moray file or to use all the polygons instead. To read the model in Moray just load the UDO file created. Make sure that the *.inc files are in the same directory.
My model is huge. PoseRay takes too long to convert it!
PoseRay allocates and deallocates memory on the fly so it will use what it needs. For every polygon the vertex, normal and UV indices are stored. To that add the actual vertex, normal and UV list of floats and the memory requirements grow quickly. To use PoseRay effectively with very large models (hundreds of thousands of polygons) it is best to export the model from Poser in parts. For example if you have two charactes in Poser export them separately. Once they are converted they can be merged in POV-Ray just by including one of the mesh files into the main *.pov file of the other and have a statement at the end to call the extra mesh. The same could be done with Moray. The UDO files could be produced separately and then inported separately into Moray. When exporting separate models of the same scene make sure that they have the same scale and translation options in PoseRay.
How do I use textures with no transparency (or images with bump maps) in POV-Ray/MegaPOV?
If you are using POV-Ray 3.1g then convert your textures or bump maps to PNG format. There are many free converters that should work. Also PaintShop Pro 7.0 does this. To save on load time and file size you may want to reduce the color depth. Simple textures do not have any transparency information and can have a lower color bit depth. With bump maps just convert them to grayscale and save them as PNG. POV-Ray 3.5 has JPG and TIFF support so that most of the textures can be used unchanged. Note: For some reason POV-Ray has problems with some texture files. Try to resave them or convert them to another format. This is a known issue.
How do I use textures with transparency in POV-Ray/MegaPOV?
Using Paint Shop Pro 7.0 (PSP) is rather easy if you have the Poser4 texture and transparency map files. Here are the steps:
- Start PSP and load the texture and transparency map files.
- Select the window with the texture in it and go to masks | new | from image.
- In the dialog box that comes up select the image with the transparency. Select by source luminance and uncheck invert mask data. Click OK.
- The texture window should change and have a checkered background indicating the transparent areas.
- This new info needs to be saved into the alpha channel. Select the window with the modified texture and go to masks | save to alpha channel. Use the default values and press OK.
- Now save the new texture to disk. Select the window with the modified texture and go to to file and select save as... As the output format select Portable Network Graphics or PNG. Then click on the options button on the save dialog box. The file should be non-interlaced and with an optimized palette. Then click on the optimizer button. In the PNG optimizer make sure that under the transparency tab Alpha channel transparency and Existing image or layer transparency are selected. Also the colors tab should indicate 16.7 million colors (24 bit). Click OK and the save dialog box will show up again. Type the name of the file and save it. You will notice that the resulting file is very large compared to the JPG version that was loaded. This is one drawback of this procedure. POV-Ray (or MegaPOV) does not support transparency maps. Transparency is achieved through the alpha channel of PNG and TGA files. Files must be 24bit and cannot be reduced in depth or the alpha channel will not saved.
- If you want to use some other program then make sure it can create masks from the transparency map and save them into the texture's alpha channel.
What do I do when I only have a transmap?
Again using PSP7 it would be very similar to the previous procedure:
- Start PSP and load the transparency file.
- Create a new image with the same dimension as the trans map image. This will be the texture. So now you can colorize this image as desired.
- Select the texture and continue in step 2 of the above procedure (How do I use textures with transparency in POV-Ray/MegaPOV?)
PoseRay creates a scene *.pov file that optionally can have a simple floor, light sources and a sky to show the geometry. The actual meshes are in the *.inc file. And the materials are stored in the *_mat.inc file. For example if the Poser4 raptor is converted then the files created will be raptor.pov, raptor.inc and raptor_mat.inc. The *.inc file has the meshes defined with the names of groups and materials that were in the OBJ file.
Each group in the obj file is subdivided in materials so PoseRay breaks the group into subgroups. For example: if group "head" is read and material "ear" is found then the subgroup name is "head_ear_23" where 23 would be the global number of the current subgroup starting from 1. The nuber is needed in the case where the group could use the same material more than once thus preventing ambiguous names. If there are no group names then they will be labeled "group". Any characters in the group or material names that are not alphanumeric or "_" are replaced by the character "_".
The meshes then are used at the bottom of the *.inc file to create many objects each using a different material. A union is used to merge them all into a single large object. The materials stored in the *_mat.inc file can be easily edited to change surface properties. Check the POV-Ray documentation for the many options available.
If you have problems with this program or have suggestions send me a message to flyer_2000@excite.com
Here are a few troubleshooting items:
EOF