Archived

This topic is now archived and is closed to further replies.

Mihail121

Mip level selection

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Well i don''t need per-pixel for my current project.Anyway the trick with the sum and relation of pixel/texel seems to work so i''ll use it.Hey COD1F1ED,do u know real fast method for software bump-maps.I''ve found some documents but they only use hardcoded methods.

"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

Share this post


Link to post
Share on other sites