Need some help with LineRender9000, and some modifications...

TL;DR: I'm using Daz Studio to create 2D assets that make use of normal, diffuse and specular maps.  In my current piepline, I have to perform seven different renders on every frame of animation.  I think there may be a way to do pull this off with just 3 renders per frame, saving a considerable amount of time and effort.  I could use some help from someone who is savvy with Daz Studio's scripting language, and knowledgeable about shaders, and maybe familiar with the inner-workings of LineRender9000.

The Long Version:

Using 3D artwork to generate pre-rendered game art has been my obsession this year.  Currently, I'm using a program that generates a normal map based on how said object would appear when lit from the front, top, bottom, left and right sides.  It was made for pixel artists, but it works remarkably well when you have five separate renders with light coming from a single direction in each.  The one problem being, there are a lot of images to keep track of.  A typical frame from an animated object might look something like: "SprName_Direction_FrameN_front.png" - with four more for the cardinal directions, one for diffuse, and one for specular.  Basically, I have a handful of different "sets" that I load an object into and render from, and there's a lot of rigorous work involving material setting, and adhering to naming convention.  I'd love to automate as much of this as I can.

Looking through the LineRender9000 documentation, I was saddened to see there were no scripted cameras that would produce a pure light-render (I'm not sure what you'd even call it. Illumination-render? Something where the texture does not appear, only how the light bounces off it).  I did notice something interesting when reading up on the Fresnel Reflection v camera. 

Ignores surface materials and renders the scene geometry using a Fresnel algorithm,
outputting the reflected vector as color information, converted to greyscale. That’s a
long-winded way of saying “the camera you should use for normal-like detail lines that
looks better than a straight output of normals would”.

Minus the greyscale part, that might be exactly what I'm trying to get! If there were a way to get a straight output of normals...well, that would be a normal map, no?  If I could simply use a modified Fresnel Reflection v script to create a colored normal map, I wouldn't have to bother with the five directional lighting renders (nor creating seprate textureless material presets for different circumstances).  I've attached a few images that sort of illustrate the process, and my desire to shorten it as much as possible.

I haven't done any scripting in Daz, but I've done enough in the past where I can have a pretty good idea of what's going on when looking through a script, provided the code is documented and clean.  Unfortunately, none of the support scripts I found for LR9K address the shaders (or shader cameras) by name.  I'm also pretty in the dark when it comes to shaders in general.  A beginner's guide to scripting in Daz Studio probably wouldn't be helpful in a situation like this one; I can see how learning it could help streamline a lot of processes, but I kind of need to migrate from being stuck on the graphics to being stuck on the game coding. (I know, I'm doing this all in a very nonsensical order).

So my question is, is there a way I could figure out which part of the script applies the Fresnel Reflection algorithm, and more specifically, which part deals with greyscaling the output? I may not be able to write my own script, but I know how to comment things out!  But...if it's clearly not that straightforward of a process, then I may have to outsource this part of the project to someone who knows what they're doing.  There's another version of this thread, somewhere down the road, that involves: Clicking on a single script from Daz Studio -> Renders N times under every necessary circumstance, and saves each image name appropriately.

Amphibioid X NormalMakin.png
640 x 480 - 62K
MFv-Normal Comparison.png
512 x 512 - 38K

Comments

  • djigneodjigneo Posts: 283

    Here are some single render outputs from some quick and dirty shader cameras. They don't look exactly like your resulting image, but I think what you're after is possible.

    Fresnel reflected v (no greyscale conversion) and Normals

    Happy to share the cameras with you if you give me an email in a PM.

    camera test_02_Reflected v.png
    500 x 492 - 73K
    camera test_03_Normal variable.png
    500 x 492 - 56K
Sign In or Register to comment.