Homeโ€บ Technical Talk

xNormal - MASTER THREAD

15355575859

Replies

  • ajherzog1234
    Any good threads on what high poly normal overrides are used for.... or can anyone give a brief description of the use.
  • jogshy
    Offline / Send Message
    jogshy polycounter lvl 17
    Any good threads on what high poly normal overrides are used for.... or can anyone give a brief description of the use.
    That's a feature you can use to modify the resulting normals. Basically, you can UV map the HP mesh and assign a normal map. When a ray hits the HP, a normal will be fetched from the texture you specified and will be used instead of the geometric normal on the HP.

    You can perform interesing things with that like very detailed wrinkles without having to subdivide more the HP.
  • Zack-StefyRO
    hey...i get this "you need to specify a filename for the output normal map" ...and after I put the folder where I want my maps, i get this "sorry can't find a plugin for.." ...help???
    Note: I use the new version, v3.18.10 , i've reinstaled the program like 2 times...
  • madideas
    How do I bake AO in xnormal on an object from objects around it?

    The top is what I expect, regular AO and the bottom is what I'm getting in xnormal, it gives me a weird result. Am I supposed to load the object I want AO on in low definition meshes and the objects around my object in high definition meshes? Would save me so much time to bake AO in xnormal. Thank you.

    1RkxLZK.png
  • Farfarer
    You'll need to reduce the ray distance of your low poly mesh.
  • madideas
    How do I do that? I tried to set my maximum frontal ray distance and maximum rear ray distance lower and I'm just getting a different variation of the same result. Same thing with checking "limit ray distance" in the occlusion settings. Thanks.
  • madideas
  • reedweinstock
    Offline / Send Message
    reedweinstock polycounter lvl 8
    Can you UV a part of your High rez add a height map texture to it so that it bakes to your low poly? If so how do you do this?

    Reed
  • Beddall
    Offline / Send Message
    Beddall polycounter lvl 6
    Hey,

    Been using xnormal for years on different computers and today I have a problem that I have never experienced before...
    I'm trying to bake out a normal map from a high poly mesh.... what seems to be happening is that Xnormal isn't reading / writing any X+ or X- data.
    I have reset all settings to default in the tools and settings section... no joy :(
    I have reinstalled xnormal ... no joy :(
    I have tried different meshes... same results.
    I have installed latest GFX drivers... no joy :(
    if i change the channel settings in the normal map options... i can't get it to write the X+ X- info into any channel, yet I can write the Y+ Y- info into all channels.

    long story short, it's like xnormal has forgotten how to normal, and the X dimension no longer exists.

    Any ideas how I can fix this?
  • Farfarer
    Started on a 3DSMax tangent basis plugin for xNormal if anyone wants to give it a go. Seems to work pretty well, but it's not tested thoroughly yet (early days).

    http://www.farfarer.com/temp/MaxTSpace.zip
  • dreamparacite
    Offline / Send Message
    dreamparacite polycounter lvl 7
    Hey guys, I've been baking maps with xnormal for a while now but I can't seem to get non-grainy looking ambient occlusion bakes no matter what I do. Here's an album showing my settings and the issues: here: http://imgur.com/a/5GW7k and here: http://imgur.com/a/5rhvm

    Basically even with planes/hemispheres/cages and adjusting the AO settings, all my bakes have that grainy look with the jitter turned on, but without it looks like a bad quality JPG, how is one supposed to get nice quality shadows that blend when when multiplied in photoshop? I don't have issues when projecting detail from highpoly models to lowpoly ones, but I do when I use the same lowpoly model in both the high definition and low definition meshes slots. If anyone knows what I'm doing wrong please let me know. Thanks!
  • Tripl3M
    Offline / Send Message
    Tripl3M polycounter lvl 2
    Every time i use xnormal for baking normals i get these ... on every single model ... please help
    sdadasd.jpg
  • Billabong
    Offline / Send Message
    Billabong polycounter lvl 16
    Im getting some weird errors when trying to bake my AO map in Xnormal, I've circled them in red. I've tried decreasing and increasing the ray distance with no effect. this error doesn't happen in max. Any ideas?
  • dreamparacite
    Offline / Send Message
    dreamparacite polycounter lvl 7
    Every time i use xnormal for baking normals i get these ... on every single model ... please help

    Excuse the pun(s) but that seams normal (heh). The seams are where you are cutting the model and laying out the UVs correct? I believe this is specific to normal maps but from what I saw in another thread (check here) when you make a cut and xNormal tries to bake a normal map along that cut you end up with different colors on different sides of the cut and the line is where it tries to blend the two, but since they are so different it can't make a clean blend.

    I would try using edge padding when doing a normal map, that might smooth over the seam a bit.
  • Zelfit
    Offline / Send Message
    Zelfit polycounter lvl 8
    Tripl3M
    On the top one - you should make borders of your UV islands hard (hard edges in maya, different smoothing groups in 3D Max).
    On the bottom one - it happens because projection distance is too high and it is simply projects one leg on another. You need to use external cage or lower projection distance in low-poly options.
  • Tripl3M
    Offline / Send Message
    Tripl3M polycounter lvl 2
    Thanks for the tips guys :)
    And i use zbrush for topology and uv unwrapping so i know nothing about 3d max or maya XD gonna get topogun and uv layout
  • tach
    The photoshop plugin doesn't seem to be working in CC. Other than waiting for an update, does anyone know how to make it CC compatible?
  • Sojiira
    Offline / Send Message
    Sojiira polycounter lvl 9
    tach wrote: ยป
    The photoshop plugin doesn't seem to be working in CC. Other than waiting for an update, does anyone know how to make it CC compatible?

    Im running 2014 and just copied the filter plugins into the new cc plugins folder. Works for me.
  • Fingus
    Offline / Send Message
    Fingus polycounter lvl 11
    The filters work fine in CC, but I think sometimes the installer misses it. Just copy the files to the plugins/filters directory.
  • PlateCaptain
    Hey guys,

    Anyone ever seen this before? I'm loading my highpoly, lowpoly, cage, and blocker objs into XNormal like I always do, and when I hit Generate Maps, I get the following error:

    "The highpoly model geometry set is VOID! Please, load almost one highpoly model and sure you mark it as 'Visible' in the highpoly mesh list"

    My highpoly is marked visible, and I'm not doing anything that I don't usually do in terms of workflow (this is coming from Blender). All meshes are triangulated.

    Any ideas on what might be going on here? I'm stuck!
  • Auldbenkenobi
    Offline / Send Message
    Auldbenkenobi polycounter lvl 11
    I updated Max to 2015 and then updated xNormal accordingly from .08 to .10 but now I'm getting these errors:

    hCzf8y3.jpg

    I didn't get these using 2014 and I've checked the Mesh to make sure it's nothing with that. Any ideas?
  • Ballo
    Offline / Send Message
    Ballo polycounter lvl 9
    Hi I just install last version of xnormal with 3dsmax/maya 2015. Iยดm getting some artifacts when I try to bake some normals map, it is so weird because isnยดt a problem of smooth normal or anything, Iยดm lost here, any thoughtsยฟ?

    Thanks a lot.
  • Shizzoo
    hey guys, i'm pretty new to xNormal and i have some problems with it. i trnied to bake some object but the normal maps look pretty crappy tho.

    XWjm4d0.jpg

    YR4E5ib.jpg

    could someone tell me why i'm getting these "artifacts"?
  • solidshark91493
    Offline / Send Message
    solidshark91493 polycounter lvl 6
    Quack! wrote: ยป
    No this is not how game artists do it.

    Set your smoothing groups by your uv islands to start. There are scripts that do this.

    In general at very hard edges with angles >75ยฐ you want to set a hard edge/smoothing group. Where ever you have a hardedge/smoothing group you need to detach that as a uv island.

    Force triangulate before you bake.

    These few steps will get you close to what you need, with some caveats that you will learn as you go.

    Using 1 smoothing group is very situational and far from the standard.
    You damn genius. You made me realize what I did wrong on my uv's on a test bake I was doing to learn it. >.> Smoothing group set, but the uv's were still attached.
    Now we see if it worked changing it. *edit* it worked perfectly. Thanks! First successful bake Ive ever done.. finally.
  • fatihG_
    Offline / Send Message
    fatihG_ polycounter lvl 14
    Hey guys,

    Have been having an issue with xnormal where it basically does not render the red channel properly.

    The attached image shows xnormal bake on top, mudbox bake in the middle and maya bake on the bottom.

    It looks like there is no info in the red channel, but if I crank on the contrast in the red channel there seems to be some info baked.

    I tried with 3.18.9 and 3.18.10.
    Tried reinstalling both.
    Am now downloading an older version. 3.18.7 will see how that goes.

    Does anyone know what is going on with with xnormal? Could some drivers or whatever affect the normal map renders?


    --edit--

    Looks like it was an issue with the normals of the mesh.
    Not sure what exactly fixed it but I unlocked the normals in Maya, smoothed the mesh again, as well as changed some export options.

    I noticed it started baking properly again when I changed the low poly's normal setting to 'avarage' instead of 'import' in xNormal.
  • Deutch1
    Hi can anyone tell me how to stop these results
  • fatihG_
    Offline / Send Message
    fatihG_ polycounter lvl 14
    Check the fine detail tab.
  • Deutch1
  • Chase
    Offline / Send Message
    Chase polycounter lvl 9
    rendering my maps takes roughly an hour per....didn't have this issue with a basic cube but more complex meshes cause this massive slow down. what gives?
  • Alecc
    Offline / Send Message
    Alecc polycounter lvl 5
    Hi all

    I ve problem with Xnormal



    I ve good High Poly merged, I have too a good Low Poly with UVs, and a good cage. ( You can see my meshes in attached File )

    I generated an Ambiant Occlusion with the specific tool in Xnormal.



    When I click on Generate, I have a strange Normal Map, with a big artefact and bug ( still in attached files )

    mini_150311040019271355.jpg
    mini_150311040021355213.jpg



    What is the problem ? why my UVs on Generated Normal Map is totally wrong ??



    Thank all, and sorry for my english :/
  • sylvernight
    Alecc wrote: ยป
    Hi all

    I ve problem with Xnormal



    I ve good High Poly merged, I have too a good Low Poly with UVs, and a good cage. ( You can see my meshes in attached File )

    I generated an Ambiant Occlusion with the specific tool in Xnormal.



    When I click on Generate, I have a strange Normal Map, with a big artefact and bug ( still in attached files )

    *images removed to save space*


    What is the problem ? why my UVs on Generated Normal Map is totally wrong ??



    Thank all, and sorry for my english :/

    I had this same problem when my Hi def model was pushed too far forward(or backward, or any direction really) from my low poly and cage. once i made sure everything was better aligned, i got more accurate results. So i'd say check to make sure your LD and cage match your HD
  • sylvernight
    Edit: Consider this issue resolved. After a little more patience and another attempt at a cage I was able to get a succesfull gorgeous bake with no artifacts!

    I will leave this post here though for future reference.

    the fixed cage and making sure 'use cage' was checked helped, haha. I was getting some alignment issues because i was bouncing between zbrush and blender. to resolve the issue i just threw my LD and Cage over my HD in zbrush and reexported everything from there and it baked fine.


    I'm making a novice mistake and I know it. I feel like I should also know how to solve this problem but nothing i've tried has work.

    I'm pretty certain its a ray-casting issue. I've never baked a model with so many 'extremes' before, in terms of geo being so close, and so far away. since the artifacts are only appearing in areas that are very very close, i'm guessing its indeed a raycasting issue.

    any tips on how to fix this would be greatly appreciated:

    renderartifacts1.jpg
    renderartifacts2.jpg
    renderartifacts3.jpg
    renderartifacts4.jpg


    Turns out Xnormal had 'use cage' checked. while i have a cage, it apparently wasn't using it at all to bake. rebaked using cage and somehow got.. worse results but i know those are the result of my cage not aligning properly with my LD and HD. Will keep trying, but any feedback is appreciated.
  • Alecc
    Offline / Send Message
    Alecc polycounter lvl 5
    Ok, problem fixed, I don't know why, but when I export in Obj or FBX from Zbrush, my model is still rotationed to 90ยฐ....

    I ve second problem :

    I ve a new object, witch High poly, Low Poly and a cage. But when I generate the map, he doesn't consider all arae under the MapWorld.

    How to recuper the low part ?? normally, I ve sculpt a big ornament :/
  • Mr Significant
    Offline / Send Message
    Mr Significant polycounter lvl 11
    First of all, Zbrush is rotating model in 90 degree's by default. But its only when you start sculpting with its default meshes. Imprted models should be in position and rotation, just like you set it. Try to reset Xform before exporting.

    Second of all, You have to make explode bake, Just separate all meshes from each other. Then do bake. Offcourse you have to move HP meshes aswell.
  • Dklang
    i cant uninstall it... and why does it use java, its not 2005...
  • Hellfire
    Offline / Send Message
    Hellfire polycounter lvl 14
    Is there a script for batch export from 3ds max to xnormal? I have a very complex scene with 207 meshes, all must bake. :(
  • stuffinmyhead
    Offline / Send Message
    stuffinmyhead polycounter lvl 6
    I am new to high poly modelling and i am currently working on a vehicle i want in a game, have done a low poly model before.

    But i have created some high poly objects and im not done, but im just wondering how the workflow/procedures to do the normal mapping?
    Do you do high poly first then use wrapit to make a low poly object then do UVW mapping? and then normal mapping with xnormal?

    because if i try to do high poly and then UVW map my 3DS MAX just lag too much.
  • AdvisableRobin
    Offline / Send Message
    AdvisableRobin polycounter lvl 10
    You don't need to unwrap the highpoly model. Only the lowpoly needs to be UV mapped.
  • pachermann
    hi all

    i know somewhere could be an answer to my xnormal viewer crash in the forum, but i can't find it.

    I have installed the current xnormal and if i start the viewer and try to klick "show cage" it crashed while searching some lua files.

    i use win7 prof.


    xnormal_error.PNG
  • pachermann
    omg, i did not see that the installer sets a wrong path X:

    my fault:
  • MRRadioactiv
    Offline / Send Message
    MRRadioactiv polycounter lvl 10
    i have the same error...
  • DasFroDo
    I have the same problem. Any way to fix it without downgrading to 3.18.10 ?
  • DasFroDo
    Fixed it!

    Always good to have friends that know programming...

    Go to .../xNormalLocation/ui/ and open up controls.lua with your editor
    Delete everything in it and paste this:
    --[[
    	xNormal UI generic controls
    	(c) 2005-2015, S.Orgaz.
    --]]
    
    dofile ( xn_get_ui_path() .. "utils.lua" )
    dofile ( xn_get_ui_path() .. "input.lua" )
    
    -- ---------------------------------------------------------------------------------------------	
    -- Some custom controls
    -- ---------------------------------------------------------------------------------------------
    control = 
    {
    	x=0.0, y=0.0, width=100.0, height=100.0,
    	
    	color = { r=1.0, g=1.0, b=1.0, a=1.0},
    	
    	uvRect = { startU=0.0, startV=0.0, endU=1.0, endV=1.0 },
    	
    	text = "",
    
    	Setup = function ( self, dTime )
    	end,
    	
    	Draw = function ( self )
    		xn_draw_overlay ( self.x, self.y, self.width, self.height, UI_TEXTURE,
    			self.color.r, self.color.g, self.color.b, self.color.a, self.uvRect.startU, self.uvRect.startV,
    			self.uvRect.endU, self.uvRect.endV )
    			
    		xn_draw_text ( self.x, self.y, self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    	end,
    
    	share = function ( self, o )
    		o = o or {}
    		setmetatable(o, self)
    		self.__index = self
    		return o
    	end,
    	
    	new = function ( self, o )
    		--[[
    			By default, LUA copies table by REFERENCE, not by value, so we need the copy_table function
    			to copy tables by value.
    			
    			Do see it do this:
    				table1 = {r=1.0, g=2.0, b=3.0}
    				table2 = table1
    				table2.g = 90.0
    				print(table1.g) gives 90!
    		--]]
    		local obj = copy_table(self)
    		
    		for k,v in pairs(o) do
    			obj[k] = v;
    		end
    		
    		return obj
    	end
    }
    
    button = control:new
    {
    	mouseOverUVRect = { startU=0.0, startV=0.0, endU=1.0, endV=1.0 },
    
    	mouseOver = false,
    	
    	Setup = function ( self, dTime )
    		self.mouseOver = ( inputState.mouseX>=self.x and inputState.mouseX<self.x+self.width and
    			inputState.mouseY>=self.y and inputState.mouseY<self.y+self.height )
    	end,
    	
    	Draw = function ( self )
    		local dr = self.uvRect
    		if ( self.mouseOver )
    		then
    			dr = self.mouseOverUVRect
    		end
    		
    		xn_draw_overlay ( self.x, self.y, self.width, self.height, UI_TEXTURE, self.color.r, self.color.g,
    			self.color.b, self.color.a,	dr.startU, dr.startV, dr.endU, dr.endV )
    			
    		local tWidth, tHeight = xn_measure_text(self.text)
    		xn_draw_text ( self.x+((self.width-tWidth)/2), self.y+((self.height-tHeight)/2),
    			self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    	end
    }
    
    checkbox = control:new
    {
    	checkedUVRect = { startU=30.0/255.0, startV=(255-79)/255.0, endU=48.0/255.0, endV=(255-97)/255.0 },
    	uvRect		  = { startU=6.0/255.0, startV=(255-79)/255.0, endU=24.0/255.0, endV=(255-97)/255.0 },
    
    	checked = false,
    	
    	Setup = function ( self, dTime )
    		if ( inputState.mouseLeftButtonReleased and 
    			 inputState.mouseX>=self.x and inputState.mouseX<self.x+self.width and
    			 inputState.mouseY>=self.y and inputState.mouseY<self.y+self.height  )
    		then
    			self.checked = not self.checked
    		end
    	end,
    	
    	Draw = function ( self )
    		-- Draw box checked or unchecked
    		local dr = self.uvRect
    		if ( self.checked )
    		then
    			dr = self.checkedUVRect
    		end
    		
    		local xBox, xText
    		local wText, hText = xn_measure_text(self.text)
    
    		if ( xn_is_rightToLeftCulture() )
    		then
    			xBox = self.x+self.width-18
    			xText = xBox - wText - 5
    		else
    			xBox = self.x
    			xText = self.x+30+5
    		end
    
    		-- Draw box
    		xn_draw_overlay ( xBox, self.y+1, 30, self.height-1, UI_TEXTURE, self.color.r, self.color.g,
    			self.color.b, self.color.a, dr.startU, dr.startV, dr.endU, dr.endV )
    		
    		-- Draw text
    		xn_draw_text ( xText, self.y+((self.height-hText)/2), self.text, self.color.r, self.color.g,
    			self.color.b, self.color.a )
    	end
    }
    
    horizontalSlider = control:new
    {
    	sliderUVRect = { startU=0.46, startV=0.704, endU=0.906, endV=0.673 },
    	ballUVRect = { startU=0.648, startV=0.645, endU=0.711, endV=0.574 },
    
    	ballColor = {r=1.0, g=1.0, b=1.0, a=1.0},
    	
    	hvalue = 1.0,
    	drawValue = 1.0,
    	
    	Setup = function ( self, dTime )
    		if ( inputState.mouseLeftButtonDown and inputState.mouseX>=self.x and inputState.mouseX<=self.x+self.width and
    			 inputState.mouseY>=self.y+(self.height/2) and inputState.mouseY<=self.y+self.height )
    		then
    			-- Calculate value and then ball position
    			self.hvalue = (inputState.mouseX-self.x) / self.width
    		end
    	end,
    	
    	Draw = function ( self )
    		local sliderHeight = self.height/3
    		local ballSize = (self.height/3)+6
    		
    		-- Draw label
    		local labelX 
    		
    		if ( xn_is_rightToLeftCulture() )
    		then
    			local mX, mY = xn_measure_text(self.text)
    			labelX = self.x + self.width - mX
    		else
    			labelX = self.x
    		end
    		
    		xn_draw_text ( labelX, self.y, self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    		
    		--Draw slider
    		local ySlider = self.y+self.height-sliderHeight
    		
    		xn_draw_overlay ( self.x, ySlider, self.width, sliderHeight, UI_TEXTURE,
    			self.color.r, self.color.g, self.color.b, self.color.a,
    			self.sliderUVRect.startU, self.sliderUVRect.startV, self.sliderUVRect.endU,	self.sliderUVRect.endV )
    		
    		-- Draw ball
    		xn_draw_overlay ( self.x + (self.hvalue*self.width) - (ballSize/2), ySlider-3, ballSize, ballSize,
    			UI_TEXTURE,	self.ballColor.r, self.ballColor.g, self.ballColor.b, self.ballColor.a,
    			self.ballUVRect.startU,	self.ballUVRect.startV, self.ballUVRect.endU, self.ballUVRect.endV )
    			
    		-- Draw numeric text value
    		valText = string.format ( "%4.3f", self.drawValue )
    		local textWidth, textHeight = xn_measure_text(valText)
    
    		xn_draw_text ( self.x+self.width+(ballSize/2)+1, ySlider+((sliderHeight-textHeight)*0.5), valText,
    			self.color.r, self.color.g, self.color.b, 1.0 )
    	end	
    }
    
    centeredSlider = control:new
    {
    	-- A slider in value range [-1,1] that autocenters ( so really detects movement increments )
    	
    	sliderUVRect = { startU=0.053, startV=0.223, endU=0.906, endV=0.15 },
    	ballUVRect = { startU=0.217, startV=0.699, endU=0.281, endV=0.625 },
    
    	ballColor = {r=1.0, g=1.0, b=1.0, a=1.0},
    	
    	hvalue = 0.0,
    	hincrement = 0.0,
    	
    	lastX = -1.0,
    
    	Setup = function ( self, dTime )
    		if ( inputState.mouseLeftButtonDown and inputState.mouseX>=self.x and inputState.mouseX<self.x+self.width and
    			 inputState.mouseY>=self.y+11 and inputState.mouseY<self.y+self.height )
    		then
    			-- Calculate value and then ball position
    			self.hvalue = (inputState.mouseX-self.x) / self.width
    			self.hvalue = 2.0 * ( self.hvalue - 0.5 )
    			
    			if ( self.lastX~=-1.0 )
    			then
    				self.hincrement = (inputState.mouseX - self.lastX) / self.width;
    			else
    				self.hincrement = 0.0
    			end
    			self.lastX = inputState.mouseX
    		else
    			-- Autocenter positions
    			self.hvalue = 0.0
    			self.hincrement = 0.0
    			self.lastX = -1.0
    		end
    	end,
    	
    	Draw = function ( self )
    		local ballSize = (self.height-11) - 3
    
    		-- Draw label
    		local labelX
    		if ( xn_is_rightToLeftCulture() )
    		then
    			local mX, mY = xn_measure_text(self.text)
    			labelX = self.x + self.width - mX
    		else
    			labelX = self.x
    		end
    		
    		xn_draw_text ( labelX, self.y, self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    		
    		--Draw slider
    		xn_draw_overlay ( self.x, self.y+11, self.width, self.height-11, UI_TEXTURE,
    			self.color.r, self.color.g, self.color.b, self.color.a,
    			self.sliderUVRect.startU, self.sliderUVRect.startV, self.sliderUVRect.endU,	self.sliderUVRect.endV )
    		
    		-- Draw ball
    		local perc = 0.5 + (self.hvalue*0.5)
    		xn_draw_overlay ( self.x + (perc*self.width) - (ballSize/2), self.y + self.height - ballSize,
    			ballSize, ballSize, UI_TEXTURE,	self.ballColor.r, self.ballColor.g, self.ballColor.b, self.ballColor.a,
    			self.ballUVRect.startU,	self.ballUVRect.startV, self.ballUVRect.endU, self.ballUVRect.endV )
    	end	
    }
    
    colorPicker = control:new
    {
    	sliderUVRect = { startU=0.46, startV=0.704, endU=0.906, endV=0.673 },
    	ballUVRect = { startU=0.648, startV=0.645, endU=0.711, endV=0.574 },
    
    	cval = {r=1.0,g=1.0,b=1.0},
    	colorChanged = false,
    	
    	Setup = function ( self, dTime )
    		local ballSize = (self.height/5)+6
    
    		if ( inputState.mouseLeftButtonDown and inputState.mouseX>=self.x and inputState.mouseX<=self.x+self.width )
    		then
    			local y2height5 = self.y+(2.0*self.height/5.0)
    			local y3height5 = self.y+(3.0*self.height/5.0)
    
    			if ( inputState.mouseY>=y2height5 and inputState.mouseY<y3height5 )
    			then
    				self.cval.r = (inputState.mouseX-self.x) / self.width
    				self.colorChanged = true
    			else
    				local y4height5 = self.y+(4.0*self.height/5.0)
    
    				if ( inputState.mouseY>=y3height5 and inputState.mouseY<y4height5 )
    				then
    					self.cval.g = (inputState.mouseX-self.x) / self.width
    					self.colorChanged = true
    				else
    					if ( inputState.mouseY>=y4height5 and inputState.mouseY<self.y+self.height )
    					then
    						self.cval.b = (inputState.mouseX-self.x) / self.width
    						self.colorChanged = true
    					end
    				end
    			end
    		end
    	end,
    	
    	Draw = function ( self )
    		local sliderHeight = self.height/5
    		local ballSize = (self.height/5)+6
    		local r = {1.0,0.0,0.0}
    		local g = {0.0,1.0,0.0}
    		local b = {0.0,0.0,1.0}
    		local val = {"r","g","b"}
    		local ySlider
    		local valText
    		local textWidth, textHeight
    		
    		-- Draw label
    		local labelX
    		if ( xn_is_rightToLeftCulture() )
    		then
    			local mX, mY = xn_measure_text(self.text)
    			labelX = self.x + self.width - mX
    		else
    			labelX = self.x
    		end
    		
    		xn_draw_text ( labelX, self.y, self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    		
    		--Draw sliders and balls ( Lua starts arrays at 1 and for includes both ranges, remember! )
    		for i=1,3 do
    			ySlider = self.y + (sliderHeight*(i+1))
    
    			-- Draw the color slider	
    			xn_draw_overlay ( self.x, ySlider, self.width, sliderHeight, UI_TEXTURE,
    				r[i], g[i], b[i], 1.0, self.sliderUVRect.startU, self.sliderUVRect.startV, self.sliderUVRect.endU,
    				self.sliderUVRect.endV )
    		
    			-- Draw the ball slider
    			xn_draw_overlay ( self.x + (self.cval[val[i]]*self.width) - (ballSize/2),
    				 ySlider-3,	ballSize, ballSize,	UI_TEXTURE,	r[i], g[i], b[i], 1.0, self.ballUVRect.startU,
    				self.ballUVRect.startV,	self.ballUVRect.endU, self.ballUVRect.endV )
    				
    			-- Draw the numeric value
    			valText = string.format ( "%03u", math.floor(self.cval[val[i]]*255.0) )
    			textWidth, textHeight = xn_measure_text(valText)
    
    			xn_draw_text ( self.x+self.width+(ballSize/2)+1, ySlider+((sliderHeight-textHeight)*0.5), valText,
    				r[i], g[i], b[i], 1.0 )
    		end	
    	end
    }
    
    colorBrowser = control:new
    {
    	r = 0.1, g = 0.1, b = 0.1,
    	mouseOver = false,
    	colorChanged = false,
    	
    	Setup = function ( self, dTime )
    		self.colorChanged = false
    		
    		local xSelA, xSelB
    		if ( xn_is_rightToLeftCulture() )
    		then
    			xSelA = self.x
    			xSelB = self.x+40
    		else
    			xSelA = self.x+self.width-40
    			xSelB = self.x+self.width
    		end
    
    		if ( inputState.mouseX>=xSelA and inputState.mouseX<xSelB and
    			 inputState.mouseY>=self.y and inputState.mouseY<self.y+self.height )
    		then
    			self.mouseOver = true
    			
    			if ( inputState.mouseLeftButtonReleased )
    			then
    				local ok, rr, gg, bb = xn_color_browse(self.r,self.g,self.b)
    				if ( ok )
    				then
    					self.r = rr
    					self.g = gg
    					self.b = bb
    					self.colorChanged = true
    				end
    			end
    		else
    			self.mouseOver = false
    		end
    	end,
    	
    	Draw = function ( self )
    		-- Draw label
    		local labelX, boxX
    		if ( xn_is_rightToLeftCulture() )
    		then
    			local mX, mY = xn_measure_text(self.text)
    			labelX = self.x + self.width - mX
    			boxX = self.x
    		else
    			labelX = self.x
    			boxX = self.x+self.width-40
    		end
    		
    		xn_draw_text ( labelX, self.y, self.text, self.color.r, self.color.g, self.color.b, self.color.a )
    		
    		--Draw a box filled with the color of the colorBrowser... if mouse is over draw a thick frame
    		local rr = self.r * 0.5
    		local gg = self.g * 0.5
    		local bb = self.b * 0.5
    		
    		if ( false==self.mouseOver )
    		then
    			rr = 1.0 - self.r
    			gg = 1.0 - self.g
    			bb = 1.0 - self.b
    		end
    		
    		xn_draw_overlay ( boxX, self.y+2, 40, self.height+1, "", rr, gg, bb, 1.0, 0.0, 0.0, 0.0, 0.0 )
    		xn_draw_overlay ( boxX+1, self.y+3, 38, self.height-1, "", self.r, self.g, self.b, 1.0,
    			0.0, 0.0, 0.0, 0.0 )
    	end	
    }
    
    
    

    Save the file and go! Working again.

    I have no idea WHAT exactly was wrong but that fixed it.

    It's basically only one line of code:
    valText = string.format ( "%03u", self.cval[val[i]]*255.0 )
    
    to
    valText = string.format ( "%03u", math.floor(self.cval[val[i]]*255.0) )
    


    Kudos to radon
  • MRRadioactiv
    Offline / Send Message
    MRRadioactiv polycounter lvl 10
    @DasFroDo
    Thx, work now again :)
  • wirrexx
    Offline / Send Message
    wirrexx quad damage
    hello beautiful Lads, need help here!


    Issue> Floating Geometry keep on adding a little bit of shades on model on the background.

    I've already turned off the to ignore backface and amped up the rays to 256 at a point. Nothing is helping.

    here's my pic.

    the floaters are circled in red on the sec picture.

    zi1LXjN.jpg
    tJe2CJR.jpg
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 9
    Hey all,

    I have a very aggravating issue happening with xNormal. I suspect I have been struggling with it for many months, but have finally narrowed it down and can reproduce it 100%. It has nothing to do with asset-setup or workflow... I'm simply getting consistently-inconsistent results from xNormal using the exact same set of assets. It appears as if the contrast/intensity of the normal map is wrong, and the only thing that corrects it is to reset xNormal's defaults... but then I only get ONE good bake before xNormal starts delivering incorrect results again.

    To clarify, I am attempting a test-bake of a simple high-rez chamfered cube. My low poly mesh is a 6-sided cube with hard-edged smoothing groups, and my UV layout has islands separated accordingly. I am using a projection cage as well. It doesn't get much simpler.

    Upon first bake, I get incorrect normal-map results. (too dark/contrasty), causing incorrect corner chamfers (see images below)

    If I reset xNormals defaults, and then set up everything identically to the first bake (using the exact same assets on disk), I get correct results. Once.

    Changing any parameter of the setup (such as switching to a different set of meshes, etc) causes xNormal to begin baking incorrect results, and the only fix seems to be to reset the defaults again... every. single. time.

    Here's a visual aid:

    xNormal_ProblemA.jpg

    Can anyone give me some advice here? It's suuuper frustrating.

    Thanks in advance,
    -eaa
  • jogshy
    Offline / Send Message
    jogshy polycounter lvl 17
    edoublea,

    the first screen seems not to have the "use cage" option enabled or you used the hard normals options. See those hard edge artifacts, that happens when you use uniform ray distances which follow normals.

    Also, is possible that in the second screen xN is using "average normals" option.
    If you wanna use the "use exported normals", you should EditMesh+ResetXForm+Collapse in 3dsmax ( or Triangulate+Freeze transformations in Maya ).

    Caution with old .OBJ exporters which create weird "vn" elements, better use gw:Obj.
    FBX is also tricky, you must set well the export options.

    I would need more info to hlp:
    1. Which output image and mesh formats and 3d modelling-export apps are you using?
    2. Which renderer are y ou using? Optix? Default? OpenRL?
    3. Screenshot of your LP & HP slots + cage setup inside 3D viewer, also hit "show tangents"
  • jogshy
    Offline / Send Message
    jogshy polycounter lvl 17
    DasFroDo,

    thx, I upgraded to latest LUA and seems there's some kind of bug there hehe.
    I'll fix it. thx!
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 9
    jogshy wrote: ยป
    edoublea,

    the first screen seems not to have the "use cage" option enabled or you used the hard normals options. See those hard edge artifacts, that happens when you use uniform ray distances which follow normals.

    Jogshy,

    Thanks much for your reply. After beginning to gather specific information to all of your questions, I think I may have gotten to the bottom of my issue.... and it seems to be a UI peculiarity of xN...

    Usually, when I am re-setting-up a new bake in xN, I clear meshes out of the "Low definition meshes" list by selecting them and hitting the delete key. Then I drag a new mesh into the window, where it appears at the top of the list. I then right-click on that mesh name to specify a Cage mesh....

    It turns out, when doing that the way that I was (hitting delete to clear the previous mesh), after dragging a new mesh into the list, xN highlights the line BELOW the mesh that was just added (the blank "*" line).... so when I right-click to add the cage, it adds the cage to the null line that was highlighted.. (effectively NOT really using my cage mesh at all)

    When using the "clear all meshes" button (or restoring defaults, apparently), the meshes list clears out and when you drag a new mesh in, THAT MESH is the one that gets highlighted.

    It still feels like a bug, albeit a much more minor one that I was worried about. Sounds like I just need to be extra careful what line is highlighted when I add my cage mesh.

    Thanks Jogshy... your reply helped me track that down.
  • jogshy
    Offline / Send Message
    jogshy polycounter lvl 17
    I see hehe! I'll revise the highlight behavior. thx!
15355575859
Sign In or Register to comment.