ThreeJS: how add PointLight to scene with PNG textures?Shadows dont work with three.js3DS Max => ThreeJs. Export sceneUpdate texture map in ThreeJSShadows black even when a light is on top of itThreejs switch sceneOverlapping PointLight Shadows using MeshLambertMaterialthreejs - morphTargets shrink other meshes in sceneThreeJS: White PNG image loaded as texture, used as material and rendered as plane has grey edgesLoading ALL textures from a URL in ThreeJSThreeJS scene with textures, why toDataUrl return black JPG?

What is the purpose of the goat for Azazel, as opposed to conventional offerings?

How come the nude protesters were not arrested?

Rebus with 20 song titles

Importance of Building Credit Score?

SQL counting distinct over partition

How to safely destroy (a large quantity of) valid checks?

Russian word for a male zebra

Using "subway" as name for London Underground?

Meaning of 'lose their grip on the groins of their followers'

How can I end combat quickly when the outcome is inevitable?

Giant Steps - Coltrane and Slonimsky

Winning Strategy for the Magician and his Apprentice

Should I give professor gift at the beginning of my PhD?

Tabular make widths equal

Colloquialism for “see you later”

Generate basis elements of the Steenrod algebra

Union with anonymous struct with flexible array member

Certain search in list

How can I make some of my chapters "come to life"?

Which languages would be most useful in Europe at the end of the 19th century?

Someone whose aspirations exceed abilities or means

Is it expected that a reader will skip parts of what you write?

Determining fair price for profitable mobile app business

A IP can traceroute to it, but can not ping



ThreeJS: how add PointLight to scene with PNG textures?


Shadows dont work with three.js3DS Max => ThreeJs. Export sceneUpdate texture map in ThreeJSShadows black even when a light is on top of itThreejs switch sceneOverlapping PointLight Shadows using MeshLambertMaterialthreejs - morphTargets shrink other meshes in sceneThreeJS: White PNG image loaded as texture, used as material and rendered as plane has grey edgesLoading ALL textures from a URL in ThreeJSThreeJS scene with textures, why toDataUrl return black JPG?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a scene with one mesh with PNG textures. I taken PointLight code from ThreeJS example and added to my project:



 var intensity = 15;
var pointLight = new THREE.PointLight( color, intensity, 20 );
pointLight.castShadow = true;
pointLight.shadow.camera.near = 1;
pointLight.shadow.camera.far = 60;
pointLight.shadow.bias = - 0.005;


But I not see light and shadows on my mesh:



no light and shadows on mesh



I created a codepen for reproduce this case



How I can resolve this issue?










share|improve this question




























    0















    I have a scene with one mesh with PNG textures. I taken PointLight code from ThreeJS example and added to my project:



     var intensity = 15;
    var pointLight = new THREE.PointLight( color, intensity, 20 );
    pointLight.castShadow = true;
    pointLight.shadow.camera.near = 1;
    pointLight.shadow.camera.far = 60;
    pointLight.shadow.bias = - 0.005;


    But I not see light and shadows on my mesh:



    no light and shadows on mesh



    I created a codepen for reproduce this case



    How I can resolve this issue?










    share|improve this question
























      0












      0








      0








      I have a scene with one mesh with PNG textures. I taken PointLight code from ThreeJS example and added to my project:



       var intensity = 15;
      var pointLight = new THREE.PointLight( color, intensity, 20 );
      pointLight.castShadow = true;
      pointLight.shadow.camera.near = 1;
      pointLight.shadow.camera.far = 60;
      pointLight.shadow.bias = - 0.005;


      But I not see light and shadows on my mesh:



      no light and shadows on mesh



      I created a codepen for reproduce this case



      How I can resolve this issue?










      share|improve this question














      I have a scene with one mesh with PNG textures. I taken PointLight code from ThreeJS example and added to my project:



       var intensity = 15;
      var pointLight = new THREE.PointLight( color, intensity, 20 );
      pointLight.castShadow = true;
      pointLight.shadow.camera.near = 1;
      pointLight.shadow.camera.far = 60;
      pointLight.shadow.bias = - 0.005;


      But I not see light and shadows on my mesh:



      no light and shadows on mesh



      I created a codepen for reproduce this case



      How I can resolve this issue?







      three.js






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 18:00









      tolyantolyan

      114114




      114114






















          1 Answer
          1






          active

          oldest

          votes


















          1














          There were multiple problems with your pen:




          • You have to tell the renderer to globally enable shadow maps like so:



            renderer.shadowMap.enabled = true



          • You have to tell the extruded shape to receive shadows:



            mesh.receiveShadow = true;


          • The extruded shaped used MeshBasicMaterial in your pen. This is an unlit material which means it does not react on lights. The codepen below now uses MeshPhongMaterial. You might want to consider to add an ambient or hemisphere light so all parts of your mesh are lit.


          Codepen: https://codepen.io/anon/pen/vPPJxW?editors=1010



          three.js R102






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326824%2fthreejs-how-add-pointlight-to-scene-with-png-textures%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            There were multiple problems with your pen:




            • You have to tell the renderer to globally enable shadow maps like so:



              renderer.shadowMap.enabled = true



            • You have to tell the extruded shape to receive shadows:



              mesh.receiveShadow = true;


            • The extruded shaped used MeshBasicMaterial in your pen. This is an unlit material which means it does not react on lights. The codepen below now uses MeshPhongMaterial. You might want to consider to add an ambient or hemisphere light so all parts of your mesh are lit.


            Codepen: https://codepen.io/anon/pen/vPPJxW?editors=1010



            three.js R102






            share|improve this answer





























              1














              There were multiple problems with your pen:




              • You have to tell the renderer to globally enable shadow maps like so:



                renderer.shadowMap.enabled = true



              • You have to tell the extruded shape to receive shadows:



                mesh.receiveShadow = true;


              • The extruded shaped used MeshBasicMaterial in your pen. This is an unlit material which means it does not react on lights. The codepen below now uses MeshPhongMaterial. You might want to consider to add an ambient or hemisphere light so all parts of your mesh are lit.


              Codepen: https://codepen.io/anon/pen/vPPJxW?editors=1010



              three.js R102






              share|improve this answer



























                1












                1








                1







                There were multiple problems with your pen:




                • You have to tell the renderer to globally enable shadow maps like so:



                  renderer.shadowMap.enabled = true



                • You have to tell the extruded shape to receive shadows:



                  mesh.receiveShadow = true;


                • The extruded shaped used MeshBasicMaterial in your pen. This is an unlit material which means it does not react on lights. The codepen below now uses MeshPhongMaterial. You might want to consider to add an ambient or hemisphere light so all parts of your mesh are lit.


                Codepen: https://codepen.io/anon/pen/vPPJxW?editors=1010



                three.js R102






                share|improve this answer















                There were multiple problems with your pen:




                • You have to tell the renderer to globally enable shadow maps like so:



                  renderer.shadowMap.enabled = true



                • You have to tell the extruded shape to receive shadows:



                  mesh.receiveShadow = true;


                • The extruded shaped used MeshBasicMaterial in your pen. This is an unlit material which means it does not react on lights. The codepen below now uses MeshPhongMaterial. You might want to consider to add an ambient or hemisphere light so all parts of your mesh are lit.


                Codepen: https://codepen.io/anon/pen/vPPJxW?editors=1010



                three.js R102







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 26 at 9:44

























                answered Mar 25 at 10:55









                Mugen87Mugen87

                4,8362624




                4,8362624





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326824%2fthreejs-how-add-pointlight-to-scene-with-png-textures%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현