How Softimage handles negative scaling?
How Softimage handles negative scaling?
While working on Soft-Game Engine pipeline I faced this common issue where negative scaled objects looks inverted in the game engine.
My question: How Softimage is able to render negative scaled objects correctly? If it uses some real-time friendly algorithm maybe it is better to implement it in the game engine instead of freezing negative scaling and fixing hierarchies/animations issues resulted of freezing scaling.
My question: How Softimage is able to render negative scaled objects correctly? If it uses some real-time friendly algorithm maybe it is better to implement it in the game engine instead of freezing negative scaling and fixing hierarchies/animations issues resulted of freezing scaling.
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: How Softimage handles negative scaling?
In my experience (not in games at all) you'd want to not have any geo negatively scaled. Only have controls, nulls, and any other types of items scaled negatively if needed. Otherwise, freeze negative scaling.
Re: How Softimage handles negative scaling?
Still wondering why Soft can do it and games cannot?
Any idea what is the math Soft is using to render negative scaled objects correctly on its viewports?
Any idea what is the math Soft is using to render negative scaled objects correctly on its viewports?
Re: How Softimage handles negative scaling?
Actually it's not all the time. If negative scaling is applied as deformation, via envelope or some ICE negative multiply, or it's applied to ICE particle primitives, normals are pointing in opposite direction. It seems it's valid only when it comes to SRT, perhaps there's some switch of normals in case of negative scale. Maybe you can flip normals on negative scaled objects, so they will sit back to desired direction, once you're in game.homam wrote:Still wondering why Soft can do it and games cannot?
Any idea what is the math Soft is using to render negative scaled objects correctly on its viewports?
Re: How Softimage handles negative scaling?
Flipping Normals fixes rendering negative scaled object in the game. However, it inverted the lighting of that object. To fix the lighting issue I tried doing two sided lighting in the game. It works but again it causes another problem where the objects look too bright because faces are lit from all lights regardless of the light direction relative to the face.
I attached a screenshot for each case.
I attached a screenshot for each case.
Re: How Softimage handles negative scaling?
Fixed! the trick is to check the combined sign of the three diagonal elements in the world transformation matrix, then you invert the mesh's normals and winding order based on that.
Now our game engine supports negative scaling for mirroring
Now our game engine supports negative scaling for mirroring
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: How Softimage handles negative scaling?
is your game engine a left hand coordinate system per chance?
Ie +z up or +z away from camera/ viewer?
Ie +z up or +z away from camera/ viewer?
$ifndef "Softimage"
set "Softimage" "true"
$endif
set "Softimage" "true"
$endif
Re: How Softimage handles negative scaling?
+z is away from the camera. +y is up.
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: How Softimage handles negative scaling?
Explain a lot. Your game engine is a left hand coordinate system, Softimage is a right hand system, +Z toward the camera, +Y is up.
Polygons are created in Softimage counter-clockwise for the normal to face outward and in your Game engine clockwise, that is why you will need to invert the normals between the game engine and Softimage.
As an example, here is Direct3D explanation and solution ... , what you did is what is recommended.
http://msdn.microsoft.com/en-us/library ... s.85).aspx
The same happen when you convert between Softimage and Max. Maya can be switch between coordinate system.
Polygons are created in Softimage counter-clockwise for the normal to face outward and in your Game engine clockwise, that is why you will need to invert the normals between the game engine and Softimage.
As an example, here is Direct3D explanation and solution ... , what you did is what is recommended.
http://msdn.microsoft.com/en-us/library ... s.85).aspx
The same happen when you convert between Softimage and Max. Maya can be switch between coordinate system.
$ifndef "Softimage"
set "Softimage" "true"
$endif
set "Softimage" "true"
$endif
Who is online
Users browsing this forum: No registered users and 25 guests