Making the same game in threeJS and Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2022
  • Code:
    github.com/ricardogonzalezest...
    github.com/ricardogonzalezest...
    Reference:
    CannonJS: github.com/pmndrs/cannon-es
    Create with Code Course: learn.unity.com/course/create...
    #gamedevelopment #gamedev #indiegamer #game #indiegamedev #gamedesign #gameart #gamedeveloper #indiedev #unity3d #unitygames #gameengine #beginners #threejs

ความคิดเห็น • 62

  • @Hoodgail
    @Hoodgail ปีที่แล้ว +68

    You should make more threejs content

  • @beardedninjagames7753
    @beardedninjagames7753 ปีที่แล้ว +36

    Just wanted throw some info on WebGL Unity as I've been using it for quite a while and may have some insight that may be useful to others.. With Unity you get a lot of powerful features from the Editor that 3js simply does not have available. However, you'll need to optimize it for the web. In this video it may not optimized (real-time shadows are enabled, for one) and you can see the performance suffer in the comparison video. You also need to take a bit of time to optimize code stripping, textures, and things like that to get the build size down. That also means setting up gzip or brotli compression and the like. That being said, there are a lot of built-in tools, and if you're making a game Unity can save you so much time in not having to reinvent the wheel.
    With 3JS the file size tends to be smaller / leaner as you're not getting a bunch of extra functionality included by default. Unity just compiles down to JS / WebGL anyways, but it tends to include some additional overhead for things like physics or even font rendering that you may not need. That adds to file size / initial loading, which is an important factor in the web. So 3JS builds are likely smaller to start with. They also feel a bit more native to me, and can handle web-specific content like gifs and glb loading, which Unity does not support by default.
    I think they both have their uses and one isn't particularly better than the other for the web - they are just different tools better suited for different projects. I think if you only need web support and don't need to be able to build for other platforms, 3JS can be a great, quick-loading, performant option. If you're making a game or app that could greatly benefit from using the Unity editor, then Unity could potentially save you a lot of time.

  • @Yuze408
    @Yuze408 ปีที่แล้ว +1

    wow thx dude this is easy to follow and learn , please make more videos just like this one 🙏🙏

  • @ViniciusValente
    @ViniciusValente ปีที่แล้ว +8

    I was calculating all the physics by hand. I'm going to study CannonJS now.

  • @krivalex
    @krivalex ปีที่แล้ว

    very good man, don't stop

  • @benjburg3343
    @benjburg3343 ปีที่แล้ว +3

    comparison of performance would be interesting to see

  • @yoyoke1
    @yoyoke1 ปีที่แล้ว

    Interesting perspective :)

  • @DJenriqez
    @DJenriqez ปีที่แล้ว +2

    In threejs you can create web engine in web browser, which will create game (I use threejs for creating 3D editors mostly so I know), in unity you can make game, making another engine is incredibly hard....

  • @randyh3761
    @randyh3761 ปีที่แล้ว

    Excellent!

  • @sar5845
    @sar5845 ปีที่แล้ว

    awesome
    subscribed!

  • @creativeplanet2820
    @creativeplanet2820 ปีที่แล้ว +1

    Thank you very much for the Video. Can u please tell us Which performs better Unity or Three js webgl?

  • @RexSounds
    @RexSounds ปีที่แล้ว +5

    met you on dc!! nice content bro

  • @suharsh96
    @suharsh96 ปีที่แล้ว

    This js great!

  • @multikillgames
    @multikillgames ปีที่แล้ว +21

    I think if you turned off gi/shadows on the car unity project would probably run way faster. Probably doubles the calculations.

    • @astrahcat1212
      @astrahcat1212 ปีที่แล้ว +2

      Also setting shader quality in Edit - Project Settings - Quality. The graphics library also matters, and if you build the project it will run way faster. Also, main thing here, shaders. Gotta optimize the shaders.
      Also, shadow quality makes a huge difference, and especially anti-aliasing.

    • @alew140
      @alew140 8 หลายเดือนก่อน

      broth is only a car with some boxs.

  • @KwamenaRoyce
    @KwamenaRoyce ปีที่แล้ว

    Inspired by this video.

  • @VisibleMRJ
    @VisibleMRJ ปีที่แล้ว +3

    WebGPU next

  • @ernestobarbaroalvarezgomez8443
    @ernestobarbaroalvarezgomez8443 ปีที่แล้ว +7

    very good, but threejs has an editor, is very basic, but it works

  • @jeremyh9841
    @jeremyh9841 ปีที่แล้ว

    what is the goal of this game ?

  • @mayukhchanda5805
    @mayukhchanda5805 ปีที่แล้ว

    Please make an elaborate video on three js and if possible how to integrate them with libraries like react or angular.

    • @placedelechange
      @placedelechange ปีที่แล้ว

      Its absolutly possible, as all others lib. But typescript will make 3js slower than habit.

    • @diegoguzman1285
      @diegoguzman1285 ปีที่แล้ว

      ​​​@@placedelechange how is it possible that Typescript makes Three JS slower? In fact, the TS compiler could make your JS even faster so I don't see how TS could affect the performance at all. You are just downloading some typings that will not be included in your bundle anyway

    • @placedelechange
      @placedelechange ปีที่แล้ว

      ​@@diegoguzman1285 simply because TS could call (typing) functions for inputs when you just need to get directly the raw value for perf, especially in shaders. For now, I never saw any TS code running faster than pure JS. Do you have source about TS faster your code so ? I do both and Im agnostic about tech.
      In all case, web assembly will replace this lack of power that JS have, so think about changing your stack :-)

    • @diegoguzman1285
      @diegoguzman1285 ปีที่แล้ว

      @@placedelechange not all in development is speed though. Sometimes, readability and maintainability is more valuable, and you gain both with TS over JS.
      Search for the optimizations the TS compiler do, there you find examples.where you can write readable code in TS that is transformed.into an optimal JS running at least as fast as something written directly in JS, without you having to think too much over those optimizations manually.
      And I don't quite understand your example very well, anything related to typing should go away after the compilation. I'm curious to know if you have any reliable source about what you mentioned

    • @placedelechange
      @placedelechange ปีที่แล้ว

      @@diegoguzman1285 To be honest, I saw only failed projects on ts for now mainly cause of breaking dependancies and types, devs often comes back to js at the end and its finally more robust in time. I (re)checked ts optim and I dont see any optimisation using it neither, maybe it more valuable for juniors that dont know js in depth, but basically peoples w/ a strong xp already code in a way it works as good as it should. Personnaly, I use ts only if needed or when I know I wont come back on code, but its slower to code (due to compilation each time you change sth) and really not confortable when you have multiples dependancies or intensive code growing (I mean not flexible enough). Better have a cypress and end to end tests to know if system is running correctly. Its just my opinion.

  • @stephenjayakar1846
    @stephenjayakar1846 ปีที่แล้ว +1

    are you actually talking? or is this an AI?

  • @prokeikas7284
    @prokeikas7284 ปีที่แล้ว +5

    I think the threejs version looks better.

  • @RayHorn5128088056
    @RayHorn5128088056 ปีที่แล้ว +2

    Why mess around with three.js when Unity can export webGL? I am not getting it.

    • @suharsh96
      @suharsh96 ปีที่แล้ว

      Familarity with JS

    • @CappySmack
      @CappySmack ปีที่แล้ว

      @@suharsh96 And an unwillingness to learn anything new? WebGL via JS is far more difficult than doing the same thing with Unity, which also supports WebGL. And you get lower quality results doing it your way. Been there and done that.

    • @suharsh96
      @suharsh96 ปีที่แล้ว

      ​@@CappySmack Web is powered via JS. A lot of web developers today work mainly with JS on both the front-end and the backend and knows the ins and outs of the language, package managers and everything else.
      As a JS dev, I would rather build up an idea in three.js than start with Unity from scratch.

    • @CappySmack
      @CappySmack ปีที่แล้ว +3

      @@suharsh96 It's always good to have a nice comfy comfort zone like JS where you don't need to learn anything new, right? Leave the big scary world to those of us who can learn anything. Unity is trivial compared to the other far more difficult technologies I have worked with during my career. WebGL in JS is far more difficult than WebGL in Unity.

    • @floskater99
      @floskater99 ปีที่แล้ว +2

      Because there are a lot of things that can't be exported to WebGL.