PDA

View Full Version : vsync + specular



zed
11-08-2006, 12:00 PM
a couple of questions

A/ (with my new card + larger screensize this is an apt time) now what causes the "wave" that u see on the screen when u dont have vsync enabled + why is this really apparent at large resolutions >1 million pixels (frame rate doesnt effect it)
i guess the card waits until it has a full frame before it displays it, any in depth articles about it

B/ ive posted about a similar thing before, im still searching for the ideal shading model.
http://www.zedzeek.com/junk/specular.jpg
the first is the standard method of specular ie color * diffuse + spec the second is
color * ( diffuse + spec*2 )
what is the more accurate, most ppl uses the first method but i find it strange that it ignores the surface properties

thanks zed

k_szczech
11-08-2006, 02:08 PM
A - this is caused because GPU switches the frames as soon as it have finished rendering but without waiting for RAMDAC to finish displaying.
This also happens in low-res, but probably due to very high framerate in low-res you get multiple, much smaller waves and you don't see them that clearly anymore.

B - how about: diffuse*diffuse_map + specular*specular_map ?
The same surface can have different diffuse and specular proparties. For example - red car can still reflect white light - with your 2nd formula that would be impossible.
Common approach is to use monochrome specular map stored in alpha channel of normal map.

zed
11-08-2006, 05:40 PM
A- well i did write framerate doesnt effect it ( i tested 640x480 at a low frameerate eg 20fps + theres no flicker, its only above a certain resolution )

B-yeah a seperate RGB spec map would be good, though i think only using the alpha channel wont be to good since spec is just gonna be white

i find shading fascinating since noone can do it right, even with todays supercomputers, thousands of hours spent of many different methods + thesis's + trying to shade a sphere + theyre all wrong, u gotta laugh

k_szczech
11-09-2006, 02:57 AM
No one can do it rightMany people can, but no one is paying them to do things right as long as there is some product to sell, but I must partially agree with you. When I look at games released today I only see that about half of the stuff was not done right - shadows are added after lighting, some objects cast shadows, some don't, some objects are hidden behind fog, some aren't, some shadows overlap - things like that. Another thing that I don't like is too much glow - it's like the developers are in love with all shiny things. HDR is just misused.
Luckily, there are still companies that allow developers to create the real product. This is how engines like Unreal 3 are made.

Overmind
11-09-2006, 03:42 AM
No one can do it rightIt's not a matter of being able to do it right. It's a matter of *wanting* to do it right.

In many cases a monochrome specular map is enough. Most shiny surfaces really reflect white light, and the surfaces that are not shiny reflect not enough light (in relation to the diffuse part) that a difference is noticable.

It's just a tradeoff, quality vs. texture memory. Most of the times it works without quality loss, and even when it's not entirely correct it's barely noticable.

zed
11-09-2006, 10:00 AM
by right i mean perfect
have a read of this
http://people.csail.mit.edu/wojciech/BRDFValidation/ExperimentalValidation-talk.pdf
look at the pictures they compare
Phong, Blinn-Phong, Ward, Lafortune et al, Ashikhmin et al ,Cook-Torrance, He et al

yet none of them are accurate, youve gotta admit thats beautiful
a picture is a thousand words so check this out
http://www.zedzeek.com/junk/shading.jpg
u would think how hard can it be a simple sphere reflecting the room (obviously it is)

V-man
11-09-2006, 05:57 PM
Originally posted by zed:
B-yeah a seperate RGB spec map would be good, though i think only using the alpha channel wont be to good since spec is just gonna be white
On most surfaces, the specular part seems to be the same color as the incoming light.
On other surfaces, the specular part can be filtered.
The filtering effect could be because of a thin film effect (soap bubble) or diffraction (CD surface)

material_diffuse * diffuse_light + material_specular * specular_light is the GL standard

IMO, (material_diffuse * material_specular) * light is good enough

Or how about making use of texture indirection?
Depending on the angle of the light, you can have custom diffuse :

dotresult = dot(lightVec, normal);
color = texture2D(dotresult);
outputColor = material_diffuse * color;

custom specular :

dotresult = dot(viewVec, normal);
color = texture2D(dotresult);
outputColor2 = material_diffuse * color;

and now, using the diffuse and spec, a custom output once again :
finalColor = texture2D(outputColor, outputColor2);