Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Gamma correction can be done via postwork only. I'm working on a small Python app for very fast gamma correction on Poser images.
Advantages: Fast (.5 sec for an image 1024x768 on a standard machine). Each color (R,G,B) can be gamma corrected individually. Color-intensity, brightness and contrast correction.
All parameters are saved between sessions. Good for series.
Should be in my free-stuff tomorrow.
Postwork only? Incorrect.
Gamma correction can be done entirely in the material room, without Poser Pro.
I have been doing Gamma correction in my AMUCFS shaders for a long time.
I am doing it now in my VSS shaders.
After reading all the references about it I've come to understand the need for symmetrical correction. Meaning you have to convert your incoming images to linear space.
You can do that in the material room, too.
Connect a Color_Math Value_1 to your image. Set function to Pow. Set Value_2 to white and connect to a Math_Function node. We're using that to make a number - no math here. Set it to 2.2.
Your incoming image is now converted to linear space.
Plug that into Diffuse node.
Color_Math Add Diffuse + Specular.
Connect to another Color_Math:Pow node with a Math_Function node, but this time use 1/2.2. That is your outgoing gamma correction.
Plug that into Alternate_Diffuse. Shut off all other root node built-in diffuse and specular.
A script could be written to transform all materials this way.
It would have to be a little more complicated to handle other cases, such as reflection and refraction or shaders that are already complicated.
I'm not saying this is easy, I'm just saying it can be done without Poser Pro and without post work.
Even if you perform final gamma in post, you really should convert incoming colors to linear space in the mat room.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Let me put it another way.
If you only do final output gamma, and do not do incoming anti-gamma, you will not get the results I'm getting with VSS or with Poser Pro. You will get something else entirely and it will be more realistic than traditional Poser renders, but less realistic than VSS or Poser Pro renders.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
@bagginsbill:
Your right, of course. Postwork never can do the same as a shader, because a shader is able to response to light directly.
On the other side: A lot of Poser images aren't candidates for shaders. Backgrounds, for example. Or characters far away.
Poser does a pure job on images. Colorspace often is reduced, Dark parts generally have to mutch black. I do images with Poser for commercial resons for a lot of years.Not one was delivered "out of the box", without a typical correction in contrast-/color-dynamic and gamma correction. This was the idea behind the scipt I made several years ago. A command line utility until yesterday :) .
By the way: For several textures it makes sense to do a gamma correction directly on the texture used (and save this modified texture for later use). For this textures no shader must first be loaded to each material anymore. So even old scenes may be processed without the need to change them.
The biggest advantage compared with shaders is that gamma correction may be processed for each color individually.
After I'm ready with this version, I'll make a version based on Poserfiles (scene, character, prop, material). Any texture found in this file is loaded then, can be corrected, saved (with another filename) and a version of this file is saved with the new/modified textures attached.
So I would need a script that would change the material nodes for EVERYTHING in the scene including "Backgrounds". I'd love to see something like that! I have no intention of paying $200 for just Gamma correction to upgrade to Poser Pro. Maybe when Poser 8 comes along it will have the Gamma correction and some worthy upgrade options that appeal to me and my broken wallet.
[quoteDo you have a screen shot of those shaders - I was playing with the idea - not sure if I got it right though
Coming right up. I'll do a step-by-step tutorial.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
There is a very low IBL for general ambience, and a single infinite light with depth-mapped shadows. The infinite light is at 60% intensity. The IBL is the HDRVFX_Office image at 12% intensity.
Normally we'd use much higher settings for these, but that's because we're trying to compensate for gamma. We won't be doing that any more. We'll be using more realistic light levels.
In the material room, we're showing the basic plastic ball material. We're going to convert this to a gamma correcting material step by step.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
This is because there is no way to post-process the output of the Root node. (too bad)
So turn off Diffuse_Value and Specular_Value.
Add a Diffuse node and Specular node with the same settings.
Combine those with a Color_Math:Add node.
Plug that into Alternate_Diffuse.
We've not changed the render at all, just the implementation.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Still no change in the render - we're just making progress towards the solution.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
The Math_Function:Add node is going to be our gamma correction value. Right now I'm leaving it at 1.0. This node is plugged into the incoming Pow node - it will perform the anti-gamma on the red color (or whatever we plug in there.)
The Math_Functions:Divide node computes 1/antigamma and applies that to the other Pow node. This node will be the outgoing gamma correction.
There is still no change in the render, but everything is now ready.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
The ball now renders very differently!
The darker areas are not so dark. The specular is no longer showing the over-blown ring around it.
In general, this is too bright! The reason is that we've always set Diffuse_Value and Specular_Value to 1, meaning 100% of the light is reflected. No real material behaves this way, and the result is the ball appears to be glowing.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
In general you want to set these to roughly 80% of what they used to be for any given material.
The ball is now finished.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
First the head.
Use the same material, but set his head texture in the Image_Map.
For skin, we don't want so much specular. Adjust the Specular node as I've done.
Also, connect the Specular_Value to the Image_Map - this will prevent the dark hair and eyebrows from showing specular effects.
Of course, for realism, we'd do a lot more to the skin, but I'm just showing a simplified example dealing with the gamma correction, not skin special effects.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
You will get these effects, along with the gamma correction materials, with my new (free) Versatile Shader System.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
There is one subtle problem that you get with gamma correction in shaders vs applying inverse gamma correction to the textures before: texture filtering will still happen in non-linear space, resulting in mip-maps that have the wrong intensities at higher levels. (for a detailed explanation, see http://www.4p8.com/eric.brasseur/gamma.html.)
For an extreme example try this image as a texture, once with PPro's gamma correction and once with gamma correction in the shader.
gamma_dalai_lama_gray.jpg
Well I don't own Poser 7 Pro nor do I intend to upgrade to it so any gamma correction I can get in P6 and P7 is better than none right?
stewer,
Absolutely - totally get that texture filtering is happening in gamma space.
I never said it was IDENTICAL to PPro :)
Anyway, as you say, GC with subtle errors is better than no GC.
In addition:
I'm chiefly concerned with GC on skin, as it is most sorely lacking there.
Skin color maps have subtle, small variations, not big ones
These small variations are usually made to DISAPPEAR when we use texture filtering in Poser, because it is too aggressive with 4K by 4K maps.
Texture filtering also causes visible seams due to accidental half-pixel shifting.
Therefore, I tell everybody to shut of texture filtering for skin and they are very happy afterward.
Bottom line - we won't have mip-map errors cause we don't use mip-maps for skin :)
When are you guys gonna put a knob in to control the texture filtering effect. I swear, it ruins almost every high-resolution texture.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Yes I do remember that. It was one of the tricks that helped deal with lack of gamma correction.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Quote - wooow. this is gamma correction for poser 6 and 7.
so basicly every cloth shader,boots shader,.... need to be changed now.
right ? :) ;)i must now change everything since this looks better.
Yes well that is one of the things that VSS Pro will be able to do for you. Gamma correction partial shader (a layer effect) will be available and can be applied to all materials in a scene.
Of course, you can do it yourself, but its a lot of clicking. :)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Or - this is a distinct possibility - SM will just patch Poser 7 to include the new gamma correction from Poser Pro. If I were them, I would do that.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
it was good. but the problem was that it could be used only in front of the object. if the light was coming on the right side for example then we saw an edge.
because of edge_blend.the same if used the edge_blend in the materials.
but this gamma correction that you did is perfect. there is no edge no matter where the light is.
bravo.
Quote - The biggest advantage compared with shaders is that gamma correction may be processed for each color individually.
After I'm ready with this version, I'll make a version based on Poserfiles (scene, character, prop, material). Any texture found in this file is loaded then, can be corrected, saved (with another filename) and a version of this file is saved with the new/modified textures attached.
ADP - I saw your new script - very nice - thank you for that.
I just want to clarify something here. You said "The biggest advantage compared with shaders is that gamma correction may be processed for each color individually."
You seem to be saying that I am somehow not processing each color individually in the shader. But I am processing each channel individually. That is what Color_Math nodes do. You define an operation and it performs them individually on all three channels, then assembles the resulting color from the 3 internal calculations.
So, a Math_Color:Pow(er) node raises each Channel of Value_1 to the power indicating by the corresponding channel in Value_2. As I'm using it, I put WHITE (1, 1, 1) in Value_2 and then connect that to a math node that equals 2.2. So the power is the vector RGB(2.2, 2.2, 2.2).
There is no reason to do it, but you can actually raise each channel to a different power, using different RGB values in Value_2.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Quote - i wanted to add a blinn to the specular for the edges.
did i do it right?
Yes you did! You have the correct idea - each new effect you must add to the others, so that GC can operate on the whole result.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
It is clearly better, and also does look like rubber, very much.
The AO may not do much unless you increase the number of samples, and the distance.
Samples needs to be 7 to 10 for good results.
What units are you using for Poser display units, and what number did you put for distance?
I am in Inches, and use 40 to 80 for distance.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Quote - i wanted to add a blinn to the specular for the edges.
did i do it right?
ok i did new tests. i am doing now a blue ball with a blinn.
under the angle the blin makes the ball look purple. if i disconnect the blinn from color math and if i then connect it to the alternate specular it looks normal and blue.
This is an example of a shader where I have already built into its basic structure a bunch of hacks that result in the correct appearance on your screen, taking into account the need to lighten the dark areas.
When I apply the manual gamma corrections, it washes out and no longer looks like I intended it to. Also, if I just use that shader and apply Poser Pro GC, it too looks washed out.
This is a shader that just doesn't work if you're going to "correct" its output at the end. It already has a bunch of stuff in it that needs to be removed, to allow the lightening to happen at the end.
Are you in some way unhappy with the appearance?
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
If you want real gold metal, with gamma correction, that is easy.
Here ya go.
Simon's shirt is using the shader shown in the material editor. That is a gamma correcting gold metal shader.
His pants are the original Gold2 from the lame pack. They look very different from gold metal, and that is on purpose.
The wall behind him is also using the same gold metal shader, but I changed the yellow to an orange, and decreased the amount of reflection by putting a darker gray in Inner_Color of the Edge_Blend node. It looks like copper colored glass.
The pole has the Silver shader from the lame pack. It works well as a brushed metal shader, such as you would see in a lacquered aluminum.
You'll have to render with raytracing and have a full surrounding environment. All of what you see in gold metal is reflections. You must have something interesting to reflect in every direction.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Attached Link: http://fantasiawear.com/ImagesClub/rd68030-gold-dress.jpg
The attached link was my reference image for the gold lame cloth shader. :)Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Just wondering.
My Freebies