1. Hi! Welcome to VRCat.club. This forum is now obsolete with the release of the official Ask VRChat forums. Please go there instead! Over time, this forum will be set to read only, and eventually removed. Move your threads and content! https://ask.vrchat.com/

Worlds [Updated] NoeNoe Pen Prefabs

Discussion in 'Tutorials and Tools' started by Noe, Nov 23, 2017.

  1. Noe

    Noe Moderator
    Forum Staff

    Joined:
    Nov 20, 2017
    Messages:
    22
    Likes Received:
    43
    VRChat:
    NoeNoe
    [​IMG]
    NEW VERSION (11th Feb 2018)

    • Added the ability to switch between five different layers and erase them independently.
    • Overhauled animations, shaders, materials, and triggers.
    • Added models, plus a custom shader/material for displaying which layer you're working on.
    • Tweaked emitters to balance performance with artistic potential.
    • Added prefabs for erasers and a bunch of different colors, plus a setup with all of them with reset buttons.
    • Moved to a new folder to prevent conflicts with other versions.
    You can now interact with the number indicator on the side of the pen to switch layers. Layers allow you to do some nice things, like drawing rough line art or guides to erase when they're not needed anymore. Keep in mind that switching a pen's layer will clear all particles drawn with it. Erasers change layer if you press the use key while holding them.
    Particles expire after an hour. Max particles for each pen is 30000, essentially about 5-6 minutes of constant drawing.

    These will still cause frame drops when a lot of particles exist. If you're worried about that, it may be wise to include a local disable switch (included in Full_Pen_Set prefab), reduce the amount of pens in your scene, or disable the collision element in every emitter (makes erasers useless).

    TO ADD A NEW COLOR
    1. Add a pen to your scene.
    2. Create a new material with the shader NoeNoe/Pen Sprite (for circle particles) or NoeNoe/Pen Color (for square) and adjust the Color input to your liking.
      [​IMG]
    3. Drag your material onto the colored part of the pen (not the shaft).
    4. Select all five of the pen's emitters.
      [​IMG]
    5. Expand the Renderer element and drag your material into the Material input.
      [​IMG]
    6. Give it a new name if you're not lazy.

    INSTALLATION

    In the zip, you'll find two files. NoeNoe_Layer_Setup must be imported first for erasing to function properly, but make backups before importing if your project already uses any custom layers that aren't part of the VRChat SDK. Once that's done, you can import NoeNoe_Pens and you're ready to go.

    To stop players colliding with erasers, click Edit, Project Settings, Physics and edit the Layer Collision Matrix to disable Player and PlayerLocal collisions with the eraser layers.
    [​IMG]

    DOWNLOAD: Google Drive

    Due to vrnico's thread over in World Building, I've spent the past couple of hours(days) playing around trying to make some pens that function similarly to the ones in the presentation room.

    [​IMG]

    First attempt, essentially a togglable trail renderer like the ones Neko, Maki and Snail have on their avatars. Looks smooth and solid, but only allows for one line; you can't erase individual segments or stop drawing without clearing the entire thing.
    You can use any material for the trail. I've included a basic unlit shader with backface culling disabled, so that it looks okay in mirrors.
    There are two prefabs of this kind, Pen_Hold is unaffected by gravity and only draws as long as the use key is held down. Pen_Toggle has full rigid body physics and drawing is togglable, so you can turn it on and then throw it for some cute effects.

    Today, I got another version working.

    [​IMG]

    Pen_Emit uses a particle emitter instead of a trail. Particles are in world space and drawing is much better, although there are visible gaps in lines depending on how fast you move the pen. You can freely stop and start drawing, and you can erase particles by touching them with the eraser on the back end of the pen, or anything on the Default, Interactive, Environment and PickupNoEnvironment layers. The eraser can also be interacted with to deactivate and clear all particles from that specific pen. I believe the performance impact is higher, since it's a large number of particles with collision, but I haven't actually been able to make my FPS go below 45 even with my mirror, videosync and avatar pedestals in shot. If left alone, particles will expire after Unity's maximum of 100,000 seconds, almost 28 hours.

    Without scripting, I don't believe it's possible to sync old particles or trails, so anyone joining after you've drawn something will not be able to see it.

    Download: https://pomf.pyonpyon.moe/sayjqs.unitypackage
    Feel free to use, modify and redistribute. Desunyan and Rhyok are helpful cutes.
     
    #1 Noe, Nov 23, 2017
    Last edited: Jun 14, 2018
    Mr.Crane, k0nest, Vic and 8 others like this.
  2. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    20171125184442_1.jpg 20171125185007_1.jpg
    holding a pen with a fist feels odd... looks like I was five or drunk when I wrote this. ^^ Anyway thanks again Noe for this awesome toy.

    EDIT: Agro seems to like it, too. x.jpg
     
    #2 Mr.Crane, Nov 25, 2017
    Last edited: Dec 1, 2017
    four, desunesu, Aev and 3 others like this.
  3. Tupper

    Tupper Admin
    Forum Staff

    Joined:
    Nov 14, 2017
    Messages:
    113
    Likes Received:
    108
    VRChat:
    Tupper
    FYI, particles are pretty cheap, especially if they aren't moving. I imagine it's take quite a bit to start lagging people with a stationary particle system.
     
  4. Saintrl

    Saintrl Member

    Joined:
    Nov 18, 2017
    Messages:
    93
    Likes Received:
    37
    VRChat:
    Saintrl
    Unless you play this game on a toaster that has single digit fps where the gpu is the bottleneck instead of the cpu lel lel lel.

    (Disclaimer: EVERYTHING and ANYTHING causes lag on a set up like the one on my toaster.)
     
  5. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    I think enough transparent layers of objects may cause some slowdown on the gpu even on stationary particle systems(think of fog/clouds). But the pen is performing well so far thanks to the unlit shader.
     
  6. vrnico

    vrnico New Member

    Joined:
    Nov 21, 2017
    Messages:
    5
    Likes Received:
    3
    VRChat:
    vr_nico
    [​IMG]

    Wow the Emit Pen (originally green in the prefab) works exactly for what I'm trying to do. The red pen or Toggle_Pen wasn't working correctly on my board, and the Hold Pen worked perfectly, just wasn't what I was looking for. Serious kudos to you @Noe for figuring this one out! Come visit my world sometime when you're in realm!
     
    Psych likes this.
  7. Jazneo

    Jazneo Member

    Joined:
    Nov 18, 2017
    Messages:
    74
    Likes Received:
    70
    VRChat:
    Jazneo
    Noe i was able to upgrade your pen prefab with snail shader with trial with the animation setting had for Emit pen


    Download Link



    [​IMG]
     
    #7 Jazneo, Dec 7, 2017
    Last edited: Dec 8, 2017
    Lamb, desunesu, Xiff and 1 other person like this.
  8. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    I hope you will upload the fixed version so it works with noenoes original in the same world. All the stuff had the same name so I had to rename the animation/controller/mesh and now both work together.
    Tested it with a few people and it seems to have some issues with the sync. others see only a rough resemblance of what you draw. Its very edgy. Maybe it helps if I set the update time from 5ms to 1ms....
     
    desunesu likes this.
  9. Lamb

    Lamb New Member

    Joined:
    Dec 20, 2017
    Messages:
    2
    Likes Received:
    2
    VRChat:
    Lambadaa
    Thanks for the prefabs, Noe and Jazneo!

    I've messed around with the prefabs and made an updated version.
    Download link:
    https://mega.nz/#!XxUHlIpR!OI1WXs6jwXpUXMYR1gwwazPFXQohrSt7voLOMyj1eb0

    Updates:

    Particle pen(Noe):
    -Increased emission over time and added emission over distance to prevent gaps at faster drawing speeds,
    -Switched particle shape to circle billboard
    -Added pen model

    Trail renderer pen(Jazneo):
    -Just added a model.

    I've ran some tests with some buddies and here's the test results:
    Test scenario: Empty world with simple unity plane and pen, 1 vrc mirror, 3 render textures with 3 cameras, up to 40 players

    Test results:
    I'm not going to go deep into the specs and frame rates, just a general comparison between the two pens.

    -Both pens works relatively fine, you're able to draw non-stop for up to 5 minutes with both pens until the frame rate drop becomes noticeable.
    -Naturally this scales with the number of players in the world and also the number of players drawing simultaneously.
    -Tests suggest that the trail renderer pen(Jazneo's) costs a slight bit more when compared to the particle pen(Noe's) performance wise.
    -Cutoffs due to ping happens to both pens, e.g. when writing at relatively high speeds, it will appear to be an illegible jumble of lines on another player's screen due to the syncing being off over network. Solution is to write relatively slowly, or get a sync script from vrc staff.
    -A very casual survey shows that the particle pen(Noe's) is more legible when written at high speeds when compared to the trail pen(Jazneo's).
    -At high player counts(30+), the pens becomes unusable from the low frame rates caused by the number of avatars and simply the number of people attempting to draw at the same time.
    -You can use a collider eraser with the particle pen(Noe's) but not on the trail renderer pen(Jazneo's)

    Drawing wise, the trail renderer pen produces a straight line each stroke, whereas the particle pen produces a lot of tightly packed circles in the form of a line. The trail renderer pen has been used on avatars and worlds succesfully, but the particle pen has only been used in worlds so far. Theoretically, the particle pen should work just fine on avatars, too, just not attempted yet.

    And that concludes the very unnecessary report on these 2 pen types. I'm planning to play around more with the particle pen to include particle trails so the number of particles emmited could be reduced and thus reducing the cutoffs due to lag and also improving performance, but then again i'm also planning on doing a bajillion things. Will update here when(if) i got the particle trail thing figured out.

    Thanks again Noe and Jazneo for the cool stuffs!
     
    Mr.Crane and Jazneo like this.
  10. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    Thanks. I'll give them a try in a little test room.

    That would be awesome. But the above mentioned sync script (maybe like in the presentation room) should be requested. ;-)
     
  11. Printer

    Printer Member

    Joined:
    Nov 18, 2017
    Messages:
    28
    Likes Received:
    30
    Where would I get the "sync script?" I was told it was on here.
     
  12. Jazneo

    Jazneo Member

    Joined:
    Nov 18, 2017
    Messages:
    74
    Likes Received:
    70
    VRChat:
    Jazneo
    just add obj sync but not really work for obj sync
     
  13. Printer

    Printer Member

    Joined:
    Nov 18, 2017
    Messages:
    28
    Likes Received:
    30
    I should add object_sync, but it doesn't really work?
     
  14. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    I was talking about the sync for people that join later. They can't see what has been drawn before they joined the world.
    The ObjectSync is only to sync animations and pickups. So others can see where you move stuff or MMD dancers are synced for all. Doesn't work for particle/trail pens, yet.....

    The presentation room and all the other VRC games use scripting components that are not available to us normal users. Thats why trails don't show for late joiner and ballgames or my shufflepuck table lag like hell compared to battle disc...
     
  15. Noe

    Noe Moderator
    Forum Staff

    Joined:
    Nov 20, 2017
    Messages:
    22
    Likes Received:
    43
    VRChat:
    NoeNoe
    Yeah, there's no way to sync for latecomers without C# scripting, or possibly PlayMaker. Lines in the Presentation Room are split into several trails which are re-drawn individually when you join, as if an invisible pen was tracing them.
     
  16. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    @Lamb The Black pen is indeed a nice improvement but on the red one you can't delete anymore.
     
  17. Lamb

    Lamb New Member

    Joined:
    Dec 20, 2017
    Messages:
    2
    Likes Received:
    2
    VRChat:
    Lambadaa
    @Mr.Crane The Collider eraser (Touch to erase) doesn't work on the red pen, since it uses trail renderers to write. The only way to erase is by using a clear all button, but the button will need to be a toggle, meaning you need to hit it twice, once to turn the ink off, and once more to turn it back on to draw. I think i might have turned off the erase button on the pen itself after feedbacks saying people kept mistakenly hitting the clear all button when trying to pick up the pen, erasing the things they don't mean to. If you look at @Jazneo's original pen, you'll be able to see the erase button. It's essentially a VRC_Trigger with a toggle gameobject active for the trail renderer.
     
  18. Jazneo

    Jazneo Member

    Joined:
    Nov 18, 2017
    Messages:
    74
    Likes Received:
    70
    VRChat:
    Jazneo
    i made the erase speed up the trail render to 0 so it delete it all at once
     
  19. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    @Lamb I used Jazneos and Noes pen before. Iknow about the eraser and the buttons and how they work. The erase all button does not work for me on your version of the snail renderer pen.
    There doesn't seem to be a button at all when you put your hand on the other end of the pen.

    EDIT: I guess it was just TLDR. You even wrote you may have disabled it...
     
    #19 Mr.Crane, Jan 11, 2018
    Last edited: Jan 11, 2018
  20. Mr.Crane

    Mr.Crane Member

    Joined:
    Nov 18, 2017
    Messages:
    167
    Likes Received:
    59
    If you limit the particles on a pen to 20.000 it has enough ink to draw but trolls cant lag spam the world with particles anymore.