Mip level selection

Started by
9 comments, last by Mihail121 20 years, 8 months ago
Hi! I''m building a software renderer and i''m working on the texture part right now.I''m planning to use bilinear filtering with mipmaps.I build the mip-levels but i don''t how to select the right level for the polygon i''m currently drawing.Please if anyone have some ideas or knowledge on this one post them here! "Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR
Advertisement
There was a Game Developer article about this way back in Nov 98. You can download the code from the article from ftp://ftp.gdmag.com/pub/src/nov98.zip

Might be of some use to you, I don''t know. I normally let the hardware worry about that sort of thing 8-)

Cheers
Run-Time MIP-Map Filtering

It is implemented in swShader/Renderer/Rasterizer.cpp
Best way IMO: Refer to the OpenGL specification, available from the OpenGL website.

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"


We come in peace... surrender or die!
Michael K.
10x i found what i need!!!10x again guys

P.S.

quote:
Best way IMO: Refer to the OpenGL specification, available from the OpenGL website.


Per-pixel mip-mapping in software renderer?!

"Tonight we strike,there is thunder in the sky,together we'll fight,some of us will die,but they'll always remember that we've made a stand and many will die by hand!" - ManOwaR

[edited by - Mihail121 on August 15, 2003 11:12:07 AM]
quote:Original post by Mihail121
Per-pixel mip-mapping in software renderer?!


I must admit I don''t know much about software renderers, so maybe this really isn''t the best solution... but it would probably look good...

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"


We come in peace... surrender or die!
Michael K.
It would look good but i need it real-time

"Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR
quote:Original post by Mihail121
It would look good but i need it real-time

Real-time per-pixel mipmapping: Real Virtuality. It only takes four operations per pixel so it nearly doesn''t slow anything down. The per-pixel code can be found in swShader/Shader/PS20Assembler::TEXLD().

Theory is explained in the previous link I gave.
The good thing about looking at the OpenGL specification is that it''s an actual *specification* (unlike Direct3d) so it often spells out exactly what is required for each part of the pipeline. Often it also introduces relaxations such as "it''s ok to approxiamte this with this" and so on. It''s not a guide to writing a software renderer, but it still contains useful info on the math.
quote:Original post by GameCat
The good thing about looking at the OpenGL specification is that it''s an actual *specification* (unlike Direct3d) so it often spells out exactly what is required for each part of the pipeline. Often it also introduces relaxations such as "it''s ok to approxiamte this with this" and so on. It''s not a guide to writing a software renderer, but it still contains useful info on the math.


Though D3D does of course have the reference rasterizer - and all IHVs are told "your device MUST behave exactly like this to be considered fully D3D compliant". Less explicit, but since the DDK contains the source, equally possible for the vendor to maintain compliance (though many devices/drivers aren''t properly 100% OpenGL *or* D3D compliant anyway)

Then again a guide written for hardware devices isn''t necessarily relevent to the software rasteriser the OP is trying to write.

I will agree though that looking at some hardware oriented specification will give a good general idea (though bear in mind that some quality-vs-performance decisions may have been taken for hardware). Other, well developed/proven software implementations such as swShader are of course something good to look at/benchmark against.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement