HELP Request: Pixel Perfect Orthographic Render - Realtime UI Stuff?


#1

I have a little problem I am trying to figure out… First off this is all in Maya Render (for realtime UI work) using Maya 7.

 I have a texture... 50 pixels by 25 pixels.  It's loaded in Maya.  I have a polygon, it's 50 units by 25 units.  Textures is applied to that poly.  I render the polygon in Orthographic mode... (I has set Orthographic Width to match resolution (25 in this case... not sure why it's reversed.)  UV's have not been touched at all, just a prefect Unitized Quad UV.  I render and it's blurry!  Why is that...?  I offset the camera by .5 on X and Y... its still blurry.  So I set the camera back to where it was.  But... If I reduce the polygon to 49x24 units it seems to render perfectly.
 
 This is confusing for me... I am more used to having the polygon set to 50x25, but then offsetting the camera to be .5 pixels off in X and Y to fix the texel vs pixel issue.  Could someone explain what is going on in Maya or where I can find more docs on the matter.
 
 Anyway... the only error I currently have when I compare my render with the original texture is that the Maya render is cropped 1 pixel around the entire boarder... so even though the rendered image is the exactly the correct size (50x25) the edge of the image is slightly see-though, but all the other pixels perfectly align.
 
 Any help would be greatly appreciated.

----- Edit Additional Findings ----

So, I found a funny inconsistency with the “Orthographic Width” setting, if camera view, is set to “Fill”… in Maya Render the “Orthographic Width” is really should be the “Orthographic Height”… might be a bug, however, if you switch your render to Mental Ray you have to set the “Orthographic Width” to the actual width… To me seems like Mental Ray is correct, but either way Mental Ray is inconsistent with the implementation of Maya Software Render, so that in itself is a bug.


#2

Basically the texture is stretched across the surface, not placed upon it.

I’m not sure of the technical terms but, I believe by default Maya blurs the pixels of the texture when it applies it to the surface. By making the object smaller you increase the sample rate of what is rendered to the surface, but it’s still blurred, however because the surface area is smaller it appears like you have better detail.

The reason it blurs it is because most faces are irregular & it recalculates the texture to suit the face.

Their may be some functionality to disable this, but I dont know Maya that well.


#3

[Added to main post.]


#4

I know what you are saying but that is not the case here. I have a 1:1 ratio of Texels Space to Camera Sample Space, and in Orthographic mode (the poly is Perpendicular and not rotated) there is no angle distortion.

I think you are talking about “Texture Filtering” what is commonly know as MIP mapping in games. But you can disable this but turn this off under the “Hardware Texture Display Options” by setting the “Texture Filter” mode to "Unfiltered. But this is a real-time display issue and doesn’t effect the Software render.

Yup, your right, this is typically know as Texel Density… but again, the Texel Densitiy for my purpose is 1:1.


#5

Well… after a night of thinking I am assuming this is what is going on.

[ul]
[li]The Polygon Size:[/li][list]
[li]has to be 1 unit less then the sample ration because of a base 0 vs base 1 issue.[/li][li]so like all Array Math, 0-54 = 55 objects[/li][/ul]
[li]The UV’s[/li]

[ul]
[li]Maya if fudging the truth with what visually makes sense.[/li][li]The UV’s look like you are sampling a box [0,0]-[50,25]… but internally it’s really sampling [0,0]-[49,24] (Key: Not is U,W space [TopLeft.U,TopRignt.W]-[BtmLeft.U,BtmRight.W])[/li][/ul]
[li]The Camera[/li]

[ul]
[li]Note: With the render set to match the resolution of the texture (1:1)[/li][li]Inconsistencies with Maya Software vs. Mental Ray with “Orthographic Width Setting” if View is set to “Fill”.[/li][li]Camera seems to sample upper left corner of the pixel (there for not .5 offset necessary)[/li][/ul]
[/list]If anyone can cofirm this it would make me feel better… it seems correct to me. I am going to do some more tests with Polygons as Pixels.


#6

I’m not sure if I correctly understand your problem and got completely lost at your last messages. But what I gather is that you have 2 problems – blurred texture when software rendered, and adjusting the orthographic view to mach the size you your poly plane which is matching the proportions of your file.

I’ll share my general knowledge about all this and hopefully it may apply and be useful to your case.

 I made a quick test along the lines of what you are testing. I created a texture file with pixel resolution of 50 wide x 25 high. I created a poly plane, and in its creation node, I changed the Width to 50 and Height to 25. I assigned the texture to the plane. In the Render Globals, I changed Width to 50 and Height to 25 for the image size, and Pixel Aspect Ratio of 1. I displayed the resolution gate in the top orthographic view.  I selected the top view camera and typed 50 for its Orthographic Width attribute.

The resolution gate matched perfectly the poly plane.

About blurring of the texture, Maya interpolates (resample) the resolution of the textures when making the image or part of it larger or smaller than the original depending on the size and angle of the view. This is always the case with one exception and you are making a test with the case that is the exception.

After you import a texture file, Maya first resizes it to a square. This is the first hit on the pixels if your file is not a perfect square. The Hipershade swatches show clearly this distortion. When you map this file to a geometry with different proportions, the pixels receive another hit, even though, the size of the geometry may be completely proportional to the original texture size. Maya offers several filters (resampling methods) for the pixel resizing. They are listed under the filter type attribute in the texture node.

 So to avoid blurring, create your texture as perfect square – 50 x 50. When imported, increase the coverage to 2 for the V in the place2dTexture node, and translate the frame along V to to achieve the original position on the poly plane. Set the filter type in the file node to Off. This should eliminate texture blurring in your particular scenario. However the lighting of your render may differ from the original's light levels depending on the light and material used.  Maya’s default light and shader won’t reproduce the light levels of the original texture files identically.

 I hope this helps

#7

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.