Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to eliminate phong normal intepolation?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 santa01   Members   -  Reputation: 307

Like
0Likes
Like

Posted 16 May 2012 - 09:32 AM

So I'm learning Phong illumination technique. I have an ambient + diffuse lighted cube with light directed orthogonally to one of the faces (see attachement). Neighbour faces are partially lighted which is technically correct due to normals interpolation but looks unnatural so I'm looking forward on how to eliminate such effect.
My thoughts on how to `eliminate' normals interpolation in partial cases are:
- duplicate mesh verticies and give them proper orthogonal normals (complicates asset creation/export steps and makes mesh larger);
- make mesh edges rounded (complicates geometry);
- add a `correction' normal map;
- add another vertex attribute to indicate if we should use existing normal or calculate a new orthogonal one (also makes mesh larger);
- write another shader to perform flat-shading (will affect all the mesh);
My goal is to correctly shade shapes like cylinder where top and bottom faces should be flat shaded and all other surface smooth shaded.

Attached Thumbnails

  • render.png


Sponsor:

#2 szecs   Members   -  Reputation: 2138

Like
0Likes
Like

Posted 16 May 2012 - 02:38 PM

First option. Asset creation shouldn't be much of a problem, there are many options to split the mesh in an editor (you can for example select faces by smoothing group and detach the selected portion of the mesh). Or the mesh can be split by the loading function in your program, that's a bit complicated to solve, but not that advanced.
Note, that you don't have to duplicate/triplicate/quadruplicate all of the vertices, only the ones that share faces with different smooth IDs (so they don't belong to the same smooth surfaces), so in most cases that doesn't mean too much extra mesh data.
Note 2: it's the same story with different texture coordinates at the same vertex: you have to split the vertex.


The other options are big no-no.

Edited by szecs, 16 May 2012 - 02:44 PM.


#3 santa01   Members   -  Reputation: 307

Like
0Likes
Like

Posted 16 May 2012 - 05:38 PM

First option. Asset creation shouldn't be much of a problem, there are many options to split the mesh in an editor (you can for example select faces by smoothing group and detach the selected portion of the mesh). Or the mesh can be split by the loading function in your program, that's a bit complicated to solve, but not that advanced.
Note, that you don't have to duplicate/triplicate/quadruplicate all of the vertices, only the ones that share faces with different smooth IDs (so they don't belong to the same smooth surfaces), so in most cases that doesn't mean too much extra mesh data.
Note 2: it's the same story with different texture coordinates at the same vertex: you have to split the vertex.


The other options are big no-no.


Sounds resonable, thx.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS