Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => [Max] Resolved Feature Requests => Topic started by: Kilja on 2017-06-21, 15:50:42

Title: Create Watermarks
Post by: Kilja on 2017-06-21, 15:50:42
Hello

I sometimes have to put on Watermarks on the renderings, with the name of the architecture firm.
I could easily do it afterwards in Photoshop, but i hate every step i have to do outside of rendering, because even after the smallest change in the image you have to do the steps in Photoshop again. So i tried it in 3ds max, i made just a plane and put a material with the opacity map from the logo on it.

The Problem is in evening scenes the white logo becomes grey. And with self illumination it is white, but it is effected by bloom and glare which is not what i want.

How would you create something like this in 3ds max and corona?

Thanks for help
Title: Re: Create Watermarks
Post by: romullus on 2017-06-21, 16:53:57
Try this:
Title: Re: Create Watermarks
Post by: Frood on 2017-06-21, 17:49:01
There is no acceptable solution atm. for this unfortunately.

Before cVFB got all the advanced features which CoronaOutput could not fully reverse anymore, I used to had a plane linked to the camera with a material like romullus described in the max startup scene (examples and only one  (https://forum.corona-renderer.com/index.php/topic,12656.0.html) of many problems with such an approach - even if not using DOF or B&G which are the most obvious).

My previous solution (http://www.scriptspot.com/3ds-max/scripts/infooverlay) for this (a max render effect, so nice!) did not harmonised with Corona at all.

I was about to request some map/mage overlay some time ago but declined because I do not want to have an even more complex VFB in Corona. But maybe... :]



Good Luck



Title: Re: Create Watermarks
Post by: PROH on 2017-06-21, 19:46:56
Well, I would really like to be able to ad a logo/watermark directly in Corona VFR. Maybe a solution like the one in VFB+. Which by the way is free now :)
Title: Re: Create Watermarks
Post by: romullus on 2017-06-21, 21:37:59
I wonder who will be the first to ask post to facebook button in Corona VFB? :]
Title: Re: Create Watermarks
Post by: TomG on 2017-06-21, 21:49:20
I wonder who will be the first to ask post to facebook button in Corona VFB? :]

That's not a good idea.

As for adding a Post to Instagram in the Corona Image Editor so you can use all its filters and effects on your photos, well that's a different story! :)
Title: Re: Create Watermarks
Post by: Jahman on 2017-06-22, 00:06:58
Pretty doable.
Change logo image path to yours.

Code: [Select]
/*
/ Script: Overlay custom logo over rendered image
/ Author: Panteleev Sergey
/ Year: 2017
/ Contacts: fatbbc @ gmail.com/
*/
try (destroydialog X ) catch ()
rollout X " Logo overlay by Jahman" width:250 (

spinner logoXoffset "x:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40 across:3
spinner logoYoffset "y:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40
spinner alphaMult "alpha:" range:[0.0,1.0,1.0 ] fieldwidth:40 scale:0.05

button preview "preview logo overlay"

local rend
local logo = openBitMap "C:\Users\User\Documents\firefox-256.png"

on preview pressed do (

try ( unDisplay rend ) catch()
rend = getLastRenderedImage()

if isKindOf rend bitmap and isKindOf logo bitmap do (

pasteBitmap logo rend [0,0] [ logoXoffset.value, logoYoffset.value ] type:#blend alphaMultiplier:alphaMult.value
display rend

)


)
)
createDialog X pos:[100,100]
Title: Re: Create Watermarks
Post by: Christa Noel on 2017-06-22, 07:16:10
Pretty doable.
Change logo image path to yours.

hi Jahman, that's a nice idea, how did you read my mind :P

a suggestion:
to prevent string literal, you guys can add "@" to your filePath which will become
Code: [Select]
@"C:\Users\User\Documents\firefox-256.png"or
to change it to bitmap selection dialog, you use selectBitmap()
Code: [Select]
/*
/ Script: Overlay custom logo over rendered image
/ Author: Panteleev Sergey
/ Year: 2017
/ Contacts: fatbbc @ gmail.com/
*/
try (destroydialog X ) catch ()
rollout X " Logo overlay by Jahman" width:250 (

spinner logoXoffset "x:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40 across:3
spinner logoYoffset "y:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40
spinner alphaMult "alpha:" range:[0.0,1.0,1.0 ] fieldwidth:40 scale:0.05

button preview "preview logo overlay"

local rend
local logo

on preview pressed do (

try ( unDisplay rend ) catch()
rend = getLastRenderedImage()
logo = selectBitmap()

if isKindOf rend bitmap and isKindOf logo bitmap do (

pasteBitmap logo rend [0,0] [ logoXoffset.value, logoYoffset.value ] type:#blend alphaMultiplier:alphaMult.value
display rend

)


)
)
createDialog X pos:[100,100]



Title: Re: Create Watermarks
Post by: Jahman on 2017-06-22, 09:11:21
yeah, logo deserves it's own button


ps. Another way one could approach this task is to use Mix or Composite map with .png logo and then just render this map.
What I like about it is that you have tiling and rotations right from the box.

Code: [Select]
/*
/ Script: Overlay custom logo over rendered image
/ Author: Panteleev Sergey
/ Year: 2017
/ Contacts: fatbbc @ gmail.com/
*/
try (destroydialog X ) catch ()
rollout X " Logo overlay by Jahman" width:250 (

spinner logoXoffset "x:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40 across:3
spinner logoYoffset "y:" range:[-1e6,1e6, 0 ] align:#left type:#integer fieldwidth:40
spinner alphaMult "alpha:" range:[0.0,1.0,1.0 ] fieldwidth:40 scale:0.05
button selectLogo "pick overlay image" across:2
button preview "preview logo overlay" enabled:false

local rend, logo

on selectLogo pressed do (

logo = selectBitMap caption:"Select overlay image"
preview.enabled = isKindOf logo bitmap

)

on preview pressed do (

try ( unDisplay rend ) catch()
rend = getLastRenderedImage()

if isKindOf rend bitmap and isKindOf logo bitmap do (

pasteBitmap logo rend [0,0] [ logoXoffset.value, logoYoffset.value ] type:#blend alphaMultiplier:alphaMult.value
display rend

)


)
)
createDialog X pos:[100,100]
Title: Re: Create Watermarks
Post by: Frood on 2017-06-22, 11:25:32
That´s a good start. What would be the options to make this mockup batch/BB capable with persistent values for x/y/path (and additionally scaling which I would do resolution dependend) per scene/maxfile? Could it easily be done as render effect? Or maybe as pre/post render script with persistent custom attributes + setup dialogue? I had a quick glance at the code of infoOverlay but could not figure out what to change to make it work with Corona. It seems the standard function for render effects "on apply()" is never called by max after rendering with Corona, only after pressing "update effect" or "update scene" in the effect preview options.

Thing is, the whole thing will be only really useable if it works automatically when rendering is done.

The map idea is interesting. What about having a standard scene map with a special name as container for the overlay which would be searched and used by the script? Maybe x/y/scaling/placement could be taken from it for alignment so no GUI is necessary at all. Would have a few advantages for a script quickie: Image access is already defined in the scene, asset tracking works, parameters would be easy to access/change and stored in the scene, post render script would only run if that special map exists. Not sure if this could work in practice, just quick brainf***s.


Good Luck




Title: Re: Create Watermarks
Post by: Jahman on 2017-06-22, 13:41:16
For some unknown reason 'on apply' works for scanline only.
But nothing could stop us from creating a #postRenderFrame callback inside 'on create' event which would then apply the effects after each rendered frame.
Since rendereffect has no 'on delete' event we can check If any rendereffect with particluar classid is present in scene and remove #postRenderFrame callback if there's no such effects exist.

But the main disadvantage of the scripted rendereffect is that we should somehow save it within a scene in order not to have problems when rendering over the network or opening. I mean Missing Dll issue.

Manual batch watermarking seems much safer for me.
Title: Re: Create Watermarks
Post by: Frood on 2017-06-22, 18:51:26
For some unknown reason 'on apply' works for scanline only.

At least not with Corona. I´ve been using infoOverlay with mr/iray without issues. Seems to be up to the renderer to do the call. Maybe for some reason Corona cannot/will not pass a valid VFB handle which is required.

But nothing could stop us from creating a #postRenderFrame callback inside 'on create' event

Yes, seems to be the only approach atm.

But the main disadvantage of the scripted rendereffect is that we should somehow save it within a scene in order not to have problems when rendering over the network or opening. I mean Missing Dll issue.

Cannot confirm. When you used one in a scene and you don´t have the (scripted) plugin installed you just get a notification about a missing plugin when opening the file, that´s all. Backburner/Batch/Renderfarm: No problem.


Good Luck


Title: Re: Create Watermarks
Post by: maru on 2019-07-26, 13:52:48
Logged basic version of this "logo overlay" in our internal tracker (I am now hiding away to avoid the wrath of the gods).
(internal id=378932518)

Moving this to resolved as a duplicate of another thread, which is currently active. (https://forum.corona-renderer.com/index.php?topic=25561.0)