Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,213 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Material LOD #28578
06/08/04 21:22
06/08/04 21:22
Joined: May 2004
Posts: 72
Brazil
S
Sylic Offline OP
Junior Member
Sylic  Offline OP
Junior Member
S

Joined: May 2004
Posts: 72
Brazil
Hi,

Itīs possible use a Material LOD in GameStudio?

Somebody has a Material LOD Code?

I search in google, but donīt found nothing.

Sorry my bad english.


Sylic Games http://www.sylic.com
Re: Material LOD [Re: Sylic] #28579
06/08/04 21:56
06/08/04 21:56
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Do you mean MIPMAPPING?

First I would use several models with different quantity of polygons for the different distances (view <-> object)
Most performance drop comes from the poly count.
But if you reduce the amount of polygons you have to hide the loss of details with a different texture applied.

If you are very close to a statue with a crack in its leg, you need to see the crack as geometry.
If you go away a bit, you don't need to model the crack - it is sufficient to alter the texture
(with a dark painted shadow at the crack position ) and use a more simple geometry.

MIP Maps are reduced in size for each LOD step and avoid the need to scale the texture
at runtime from 1024x1024 down to an object which is only 75 pixel heigh at the time of rendering.

So, what do you need?

-- slacer

Re: Material LOD [Re: slacer] #28580
06/08/04 22:00
06/08/04 22:00
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
material lod can be easily done per script. just switch to a cheaper shader / material version once the entity is at a certain distance from the camera.

Re: Material LOD [Re: Sylic] #28581
06/09/04 00:19
06/09/04 00:19
Joined: Mar 2002
Posts: 1,123
California
Cellulaer Offline
Expert
Cellulaer  Offline
Expert

Joined: Mar 2002
Posts: 1,123
California

This code (see below) will return the distance between the current entity and the camera. Just stick it in the action of the model with the material and change the material or what have you based on the distance.

vec_dist(my.x,camera.x);

For example:

if vec_dist(my.x,camera.x)<1000 {
// lod 0
}
else
{
if (vec_dist(my.x,camera.x)>1000)&&(vec_dist(my.x,camera.x)<5000) {
//lod 1
}
else
{
if (vec_dist(my.x,camera.x)>5000)&&(vec_dist(my.x,camera.x)<10000) {
//lod 2
}
else
{
//lod 3
}
}
}


Buy, Sell, & Archive Realtime 3D Content @ RedRock7.com *BETA* A5.5+ Plugin DLLs: GSADO, GSHTTP, GSImgLst, FreeMod, GSFlash, GSPython http://cellulear.slashbang.com/
Re: Material LOD [Re: Cellulaer] #28582
06/09/04 00:36
06/09/04 00:36
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Quote:


This code (see below) will return the distance between the current entity and the camera. Just stick it in the action of the model with the material and change the material or what have you based on the distance.

vec_dist(my.x,camera.x);

For example:

if vec_dist(my.x,camera.x)<1000 {
// lod 0
}
else
{
if (vec_dist(my.x,camera.x)>1000)&&(vec_dist(my.x,camera.x)<5000) {
//lod 1
}
else
{
if (vec_dist(my.x,camera.x)>5000)&&(vec_dist(my.x,camera.x)<10000) {
//lod 2
}
else
{
//lod 3
}
}
}




But just dont do it like that. That code calls vec_dist up to 5 times. Just call vec_dist once, and store in a local var, and compare on that.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Material LOD [Re: qwerty823] #28583
06/09/04 08:32
06/09/04 08:32
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
..and we can also optimize away the ">" comparisons, but the basic idea is right.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1