Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DirectX - Generall Question

DirectX - Generall Question

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpvisual-studiographicsgame-dev
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GermanGeorge
    wrote on last edited by
    #1

    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

    E 1 Reply Last reply
    0
    • G GermanGeorge

      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

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #2

      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)

      G 1 Reply Last reply
      0
      • E El Corazon

        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)

        G Offline
        G Offline
        GermanGeorge
        wrote on last edited by
        #3

        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

        E 1 Reply Last reply
        0
        • G GermanGeorge

          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

          E Offline
          E Offline
          El Corazon
          wrote on last edited by
          #4

          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)

          G 1 Reply Last reply
          0
          • E El Corazon

            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)

            G Offline
            G Offline
            GermanGeorge
            wrote on last edited by
            #5

            <<<< thank you >>>>

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups