Announcement

Collapse
No announcement yet.

Vray light "Fit to texture"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vray light "Fit to texture"

    Hello, thanks for looking in. This is a minor thing, but it would be nice to somehow be able to see your maps on the vray light in the viewport (so we know if they are facing the right direction) or maybe having a box that sets the width and height to the dimensions of the map.

    No biggie if it's hard or a pain, just find myself rendering to check alignment instead of just flowing along.

  • #2
    It's supposed to work.
    I don't recall the exact setup (realistic viewport/DX blablabla...) but for us in 2014 it doesn't work, that's why I coded this little script here.
    What it basically does is creating a non-renderable plane at the light with the texture to visualize it. Currently only works for rectangular area lights.

    Code:
    macroScript GradientLight category:"#Pinkschwarz" tooltip:"GradientLight" buttontext:"GradientLight"
    
    (
    	--material
    	local matVerlaufMap		= VRaySoftbox name:"Licht_Verlauf" vertGradOn:true
    	local matVerlaufMtl		= VRayMtl texmap_diffuse:matVerlaufMap showInViewport:true 
    	
    	--objekte
    	local oLicht		= VRayLight size0:25 size1:25 pos:[0,0,300] type:0 color_mode:0 color:[255,255,255] texmap:matVerlaufMap normalizeColor:3 multiplier:500
    	local oPlane		= Plane length:50 width:50 lengthsegs:1 widthsegs:1 pos:oLicht.position displayByLayer:false renderByLayer:false showFrozenInGray:false backfacecull:false mapcoords:true realWorldMapSize:false material:matVerlaufMtl renderable:false isFrozen:true parent:oLicht
    	
    	--modifier
    	local mNormal			= Normalmodifier flip:true
    		addModifier oPlane mNormal
    	local mUVWXForm	= UVW_XForm U_Flip:1
    		addModifier oPlane mUVWXForm
    	local mDelMesh		= DeleteMesh()
    		addModifier oPlane mDelMesh
    		oPlane.Modifiers[1].enabledInViews 	= false
    		oPlane.Modifiers[1].enabledInRenders 	= true
    	
    	--verbindungen
    	paramWire.connect oLicht.baseObject[#size0] oPlane.baseObject[#Width] "size0*2"
    	paramWire.connect oLicht.baseObject[#size1] oPlane.baseObject[#Length] "size1*2"
    )
    
    macros.run "#Pinkschwarz" "GradientLight"
    Software:
    Windows 7 Ultimate x64 SP1
    3ds Max 2016 SP4
    V-Ray Adv 3.60.04


    Hardware:
    Intel Core i7-4930K @ 3.40 GHz
    NVIDIA GeForce GTX 780 (4096MB RAM)
    64GB RAM


    DxDiag

    Comment


    • #3
      Wow this is great! Thank you for sharing this.

      Comment

      Working...
      X