DirectX - Generall Question
-
Sorry for my poor englisch i hope i can make myself understood i need a generall help, how to solve this problem i work with directx sdk 9.0 and visual studio 2005 i have to create a lens (in spectacles). i got the modell of the lens with all the curves etc. but: the lens is made out of colored glass (let us say brown) so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material. please help. how to i start to solve this problem george
-
Sorry for my poor englisch i hope i can make myself understood i need a generall help, how to solve this problem i work with directx sdk 9.0 and visual studio 2005 i have to create a lens (in spectacles). i got the modell of the lens with all the curves etc. but: the lens is made out of colored glass (let us say brown) so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material. please help. how to i start to solve this problem george
GermanGeorge wrote:
the lens is made out of colored glass (let us say brown) so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material.
Are you only trying to change the color of the lens, or are you trying to model the refraction (light bending) of the lens? In the case of the color change set the color brown to levels from faint to heavy based on the thickness of the lens. Basically make a texture map to represent the color at each point in the material. Alternately, you can have a fixed color, brown, and vary only the alpha (transmitance) value based on the thickness of the lens. If the idea is to model both color change and light bending of the glass lens, google ray-tracing, refraction, BRTDF caustics and/or global illumination. http://www.gpgpu.org/cgi-bin/blosxom.cgi/Advanced%20Rendering/Global%20Illumination/index.html[^]
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
GermanGeorge wrote:
the lens is made out of colored glass (let us say brown) so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material.
Are you only trying to change the color of the lens, or are you trying to model the refraction (light bending) of the lens? In the case of the color change set the color brown to levels from faint to heavy based on the thickness of the lens. Basically make a texture map to represent the color at each point in the material. Alternately, you can have a fixed color, brown, and vary only the alpha (transmitance) value based on the thickness of the lens. If the idea is to model both color change and light bending of the glass lens, google ray-tracing, refraction, BRTDF caustics and/or global illumination. http://www.gpgpu.org/cgi-bin/blosxom.cgi/Advanced%20Rendering/Global%20Illumination/index.html[^]
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Hi, thank you for your answer. no, I only need the colour. three questions: 1) can you give me some code for your ideas? i would be glad to pay you for it. 2) as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility. 3) which alpha do you mean? the one of the material, the ampient alpha? sorry george
-
Hi, thank you for your answer. no, I only need the colour. three questions: 1) can you give me some code for your ideas? i would be glad to pay you for it. 2) as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility. 3) which alpha do you mean? the one of the material, the ampient alpha? sorry george
GermanGeorge wrote:
can you give me some code for your ideas? i would be glad to pay you for it.
:rolleyes: At least until you saw my rates.... I will try to point you in the right directions for free, but I rarely write code for people anymore, just too much time for too little. Plus I am strictly OpenGL most of the time.
GermanGeorge wrote:
as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility.
a texture is simply a map of memory with Red Green and Blue in following bytes, sometimes red, green, blue and alpha. Alpha is a number the same as the other colors representing the transmittance of color to a blending function. Since the blendng function is chosen by the programmer, it isn't a cut-and-dry "this is what alpha is, and this is how it works" but you can find many tutorials on alpha blending in OpenGL or DirectX, your choice. Also with the new shading capability of graphics cards, you can write your own blending function to do what ever level of blending you need. http://www.codeproject.com/cs/media/3DAlphaTransparency.asp[^] http://www.falloutsoftware.com/tutorials/dd/dd7.htm[^] http://www.codeproject.com/gdi/pxalphablend.asp[^]
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
GermanGeorge wrote:
can you give me some code for your ideas? i would be glad to pay you for it.
:rolleyes: At least until you saw my rates.... I will try to point you in the right directions for free, but I rarely write code for people anymore, just too much time for too little. Plus I am strictly OpenGL most of the time.
GermanGeorge wrote:
as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility.
a texture is simply a map of memory with Red Green and Blue in following bytes, sometimes red, green, blue and alpha. Alpha is a number the same as the other colors representing the transmittance of color to a blending function. Since the blendng function is chosen by the programmer, it isn't a cut-and-dry "this is what alpha is, and this is how it works" but you can find many tutorials on alpha blending in OpenGL or DirectX, your choice. Also with the new shading capability of graphics cards, you can write your own blending function to do what ever level of blending you need. http://www.codeproject.com/cs/media/3DAlphaTransparency.asp[^] http://www.falloutsoftware.com/tutorials/dd/dd7.htm[^] http://www.codeproject.com/gdi/pxalphablend.asp[^]
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
<<<< thank you >>>>