Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: texCubeBias and MIPMAPLODBIAS wont work  (Read 2871 times)
kTecH
Customers
Community Member
*****
Posts: 132


« on: August 22, 2010, 09:07:40 AM »

Hi.

texCubeBias() and MIPMAPLODBIAS seems not to work because rendersurface dont use mipmaps (it working in RenderMonkey and FX Composer)
It's a easy way to blur cubemap.

Any chance to enable mipmaping in rendersurface?
« Last Edit: August 22, 2010, 09:10:53 AM by kTecH » Logged
Toaster
Community Member
*
Posts: 378


WWW
« Reply #1 on: August 22, 2010, 08:02:43 PM »

convert the RS to a texture and tell it to enable mip mapping.

Blur wont turn out so good imo

if you find a really nice way to blur a cube map post the source I am really interested! Smiley

-Toaster
Logged

Visit my site at: Unknown Abstraction
kTecH
Customers
Community Member
*****
Posts: 132


« Reply #2 on: August 23, 2010, 03:57:16 AM »

but I generate cubemap each frame - this will kill performance
Logged
Toaster
Community Member
*
Posts: 378


WWW
« Reply #3 on: August 23, 2010, 12:36:10 PM »

Yeah but there isn't any other way to do it in TV. Sylvain gave me a reason once you can talk to him on IRC about it.

-Toaster
Logged

Visit my site at: Unknown Abstraction
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #4 on: August 23, 2010, 05:55:56 PM »

If you are using RenderMonkey and FX Composer, am I correct in assuming you are using
shaders in your TV3D scene rendering? If so you can blur the cubemap render surfaces
you pass to the shader in the shader code.
Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
Toaster
Community Member
*
Posts: 378


WWW
« Reply #5 on: August 23, 2010, 07:39:34 PM »

He is trying to do it with the mip map which is a great idea just TV doesn't support mip maps for render surfaces. Also if anyone could post source for a cubemap blur that would be awesome! Smiley

-Toaster
Logged

Visit my site at: Unknown Abstraction
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #6 on: August 25, 2010, 08:19:59 AM »

My apologies for not having a great deal of time at the moment, but some thoughts would be:

If shaders are involved you should be able to blur the 2D sample from the cubemap. When using a cubemap the sampling camera is in the centre of the cube and I believe you calculate sampled 2D camera view as in Arius VB.Net Tutorial 23 (HLSL shadow mapping), in the meshlight.shade shader, line 242:

Code:

SMapping(IN.SmPos, IN.Deep, DeepSample, SF_SM);


it can be seen that a 2D texture is returned from the cubemap, and subsequently used in the shader. In this case for shadow mapping, and it looks like a depth test is used, but the principle is the same. You could strip out the unnecessary code.

Then in Zac's Landscape Shadow Mapping example the are examples of how to to apply gaussian blur and PCF filtering to a sampled 2D texture.

Sorry I haven't got the time atm to go into it more deeply, but this should point you in the right direction.

Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
DarekRuman
Customers
Community Member
*****
Posts: 184

game developer


WWW
« Reply #7 on: August 27, 2010, 11:19:40 AM »

Bluring CUBE is not a problem. But its costs much speed. If we can use mipmaps on RS - CubeBias is great idea of cheep and fast bluring.
Logged

www.reddotgames.pl
tv6.3 tv6.5 developer
games made in TV : Paintball Extreme, Reindeer Adventure, Mole : Great Adventure, Foxy Fox, Włatcy móch : Śnieżna Rozwałka, Włatcy Móch : Magiczni Wojownicy, Ski:), Lowrider Extreme
Toaster
Community Member
*
Posts: 378


WWW
« Reply #8 on: August 27, 2010, 01:59:04 PM »

Why? cubebias is going to cause artifacts in the final output. Trust me I've done it before you get lines and stuff cause the mipmapping doesn't look at the other sides of a cube map which can be semi solved with PCF but not really..

Now if you had a pre loaded cube map that never changed you can use ATI's cubemap tool to make "correct" cubemap mipmaps, but anything real time you are going to get artifacts at the cubes edges..

Edit: The best way to do this really is to do something like this:

Unwrap your cubemap onto a 2D texture in some sort of format like this:


That way each face blur's smoothly onto each other. After you finish blurring that then you convert to a cubemap again and use it for whatever you need. The nice thing about it though is that you can use a lower res 2D texture since you are blurring anyways which helps speed up the process.

Look up "shaderx3 Efficient Omnidirectional Shadow Maps" if you have the book.

-Toaster
« Last Edit: August 27, 2010, 02:15:23 PM by Toaster » Logged

Visit my site at: Unknown Abstraction
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks