PDA

View Full Version : LW 10.1 Anisotropic Shader Not Working



t00lm4n
08-19-2011, 11:31 AM
A file that rendered fine in LW 10.0 does not render as I'd like it to in 10.1. Look at the way the DVD looks in the 10.0 render with radiating lines of specular reflections. The 10.1 render looks like it's rendering on the Y but circular. It's not realistic anymore and I'd like it to be.

10.0 render:
http://www.studio10b.com/lwrenders/dvd_10_0_render.jpg

10.1 render:
http://www.studio10b.com/lwrenders/dvd_10_1_render.jpg

Anybody know a work around in 10.1? I am using the node editor/shaders/specular/anisotropic with modified settings from the NewTek video tutorial on Anisotropic Shaders.

I went back to 10.0 after upgrading to 10.1. You should NOT do that. Now before every time I launch LW 10.0 I need to trash my prefs. That's getting annoying… I'd like to install 10.1 again. Any insight would be grateful.

Celshader
08-19-2011, 12:03 PM
I was not aware of any issues with the 10.1 anistropic shader. I'd have to test it to confirm this.


I went back to 10.0 after upgrading to 10.1. You should NOT do that. Now before every time I launch LW 10.0 I need to trash my prefs. That's getting annoying… I'd like to install 10.1 again. Any insight would be grateful.

This is because if you load a 10.1 scene into 10.0, the formatting of the ColorSpace information in the 10.0 configs changes.

10.0 formats the colorspace section like this:



ColorSpaceViewer Linear
ColorSpaceSurfaceColor Linear
ColorSpaceLightColor Linear
ColorSpacePaletteFiles Linear
ColorSpace8BitFiles Linear
ColorSpaceFloatFiles Linear
ColorSpaceAlpha Linear
ColorSpaceOutput Linear
ColorSpaceOutputAlpha Linear
ColorSpaceAutoSense 0
ColorSpaceCorrectOpenGL 0
ColorSpaceAffectPicker 0
ColorSpace8BitToFloat 0


After 10.1 formatting, it will look like this:



ColorSpaceViewer "\"Linear\"" "none"
ColorSpaceSurfaceColor "\"Linear\"" "none"
ColorSpaceLightColor "\"Linear\"" "none"
ColorSpacePaletteFiles "\"Linear\"" "none"
ColorSpace8BitFiles "\"Linear\"" "none"
ColorSpaceFloatFiles "\"Linear\"" "none"
ColorSpaceAlpha "\"Linear\"" "none"
ColorSpaceOutput "\"Linear\"" "none"
ColorSpaceOutputAlpha "\"Linear\"" "none"
ColorSpaceAutoSense 0
ColorSpaceCorrectOpenGL 0
ColorSpaceAffectPicker 0
ColorSpace8BitToFloat 0


I wrote a Python script just to clean up my 10.0 configs after loading a 10.1-formatted scene by accident.

If you're using Windows and not running the Hub (ie: launching Layout from a shortcut that has -0 in the Target line), you're welcome to this quick-n-dirty Python script. Install Python, replace the third line in this script with the path to your LW-10.cfg or LW64-10.cfg file, save the script as "CleanConfigs.py", kill Layout in the Task Manager whenever you get the corrupted-configs issue, and run the script to reformat the Colorspace data in your 10.0 config file:



import shutil, datetime, re, tkMessageBox, Tkinter, os

LWSpath = "C:\\LightWave_X\\Configs\\LW10-64.CFG"

tk = Tkinter.Tk()
tk.withdraw()

def getText(path):
f = open(path, "r")
text = f.read()
f.close()
return text

#
# back up original file
#
backupFolder = LWSpath.rsplit("\\", 1)[0] + "\\+Old\\"
now = datetime.datetime.now()
timestamp = "%s_%02d_%02d_%02d_%02d_%02d" % (now.year, now.month, now.day, now.hour, now.minute, now.second)
backupPath = backupFolder + LWSpath.rsplit("\\", 1)[1]
print backupPath
backupPath = backupPath.replace(".CFG", "_backup__%s.CFG" % timestamp)
if not os.path.exists(backupFolder):
print "Creating backup folder."
os.makedirs(backupFolder)

print "Backing up: " + LWSpath
print "\tTo: " + backupPath
shutil.copyfile(LWSpath, backupPath)

text = getText(LWSpath)

pattern = re.compile("ColorSpaceViewer.*?ColorSpace8BitToFloat", re.DOTALL)
chunk = pattern.findall(text)[0]

newChunk = chunk
newChunk = newChunk.replace("\"", "")
newChunk = newChunk.replace("\\", "")
newChunk = newChunk.replace(" none", "")

text = text.replace(chunk, newChunk)

f = open(LWSpath, "w")
f.write(text)
f.close()

message = "Backed up: " + LWSpath + "\n"
message = message + "\tTo:" + backupPath
message = message + "\n\n"
message = message + "Replaced:\n\n"
message = message + chunk
message = message + "\n\nWith:\n\n"
message = message + newChunk

tkMessageBox._show("Cleaned configs. Restart Layout.", message)

If you're using a Mac, I think you need to add this line to the top of the script for it to work:



#!/usr/bin/python

Medi8or
08-20-2011, 11:20 AM
There is a bug in Anisotropic shader, if you rotate object, or rotate the shader.
Rotating object is all wrong. Rotating shader is ok in 90 degree angles.

Workaround is to rotate the whole scene, camera, lights and all, around your DVD.

That's what it looks like to me, anyway...

t00lm4n
08-20-2011, 12:39 PM
Thanks Celshader for your Python script. I'm on a mac so I'll need to figure that out. I don't know python so I'll do a search on the subject how to install your script.

t00lm4n
08-20-2011, 12:40 PM
Thanks Medi8or, that's a creative work around. I think I'll just stick with 10.0 for now until that bug is fixed.