Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Everything posted by jb-dev

  1. Last week didn't have any particular theme, although it still was a busy one... Statuses First off, all statuses now have effect textures. these are really abstract, but nice to look at. (From left to right: Bleeding, Burning, Damned, Frenzied, Frozen, Knocked Out, Poisoned, Paralyzed and Stunned) Also, I've perfected statuses effects on enemies. Now their current status is a lot more obvious. A nice status icon is displayed over their head to help identify that status. The Diner Secondly, I've added a new room: the diner. The idea of it is quite simple: the diner offers food for the player to eat. The room itself is modelled after classic 50s diners with a jukebox and checkered patterns all over the place. There's even a nice neon sign that is truly aesthetic. The lighting is still a WIP, but the models themselves are pretty much done. There might be some details to add here and there, though... The exterior also needs some work. I was thinking of giving it a huge diner sign, but for now, there's nothing fancy... Crystals Lastly, I've given the player the ability to switch their active crystals. For those who didn't know, crystals are run-persistent collectables that can give the player the opportunity to take shortcuts that gives fame and fortune to whoever chooses to take them. A GUI element is displayed at the bottom of the screen. Within it, there are 3 crystal counters for each type of crystals. When the player switches their active crystal, the element rotates around to display the right counter at the right time. There's even a nice animation for it. I've only worked on this yesterday, so it still has rough edges here and there. Also, there's no discernable way to identify the active type of crystal on the GUI element alone as of yet... There are some icons that could be ready, but I want to try to put those icons in a custom font file. This way, I can use Unity's dynamic text display functionality to have scalable graphics. One of the drawbacks of this is that only monochrome icons can be used... Minor updates Modified the bank so that it spawns with a back wall Fixed bugs with MonoBehaviours scripts presets Fixed a whole lot of bugs with the map generator. Turns out that when the player was extremely lucky, they could remain trapped in the stating room because all other rooms would become secret rooms. Added a limit on how many secrets tunnel rooms can be spawned Added a ceiling to most room obstacles such as locked doors and cracked walls so that the lighting won't look weird anymore. Added back walls to special rooms. Thus, the design of those rooms will be applied continuously rather than abruptly end. Changed the tri-colour decal shader to add emission (mainly used with the diner's neon sign) This week Now that the diner is done, I can go ahead and continue the implementation of even more rooms. Last time I've talked about status-themed rooms, but turns out that there are a lot of other more important rooms to be added beforehand. I will be adding these up progressively... Now that the player knows their current active crystal type and their remaining amount, I can also add rooms dealing with those. I could also try to spawn pickable crystals, but right now rooms seem to be more important than crystals: they add more opportunities and varies the gameplay a lot. And finally, another possibility is to actually create these custom font files I've previously talked about, although it's not that important... Before I forget! Last week I've forgotten to mention that I've also tried to compose some music for the game. Here's a preview: ohok.mp4
  2. Last week I've worked on implementing statuses in the game. To put it simply, statuses negatively affect entities. Things like poisoning or bleeding, for example, will continuously dish out damage for a specific amount of time. Statuses Here's a list of some statuses and their effects. Keep in mind that statuses times aren't final and will eventually change depending on the impact of their effects... Poisoned This status is self-explanatory. It will damage the entity for about 20 seconds. The damage amount will increase linearly through time. Burning In essence, the entity is burning. Not dissimilar to being poisoned, the burning status also damages the entity for 20 seconds. The difference here is that the damage will increase using a reciprocal function. Bleeding The entity is bleeding heavily. Again, that status is like the previous two. The difference here is that the damage will increase logarithmically. Frozen The enemy is frozen solid. It can still move but at a reduced speed. Can also attack, but at a slower rate than usual. It will go away after 20 seconds. Damned The enemy is cursed. For 20 seconds, the entity will be extremely unlucky. Any luck tests will fail regardless of the entity's current luck. Paralysed The entity is paralyzed. For 20 seconds, the entity can't move. Frenzy The entity is caught up in a violent frenzy fits. If the entity isn't the player, then they will ignore the player and attack its friends. If the entity is the player, then the situation is reversed: every entity will attack the player. It lasts for 20 seconds. After then, the fits end. Here's a video of frenzied enemies fighting themselves: InAFrenzy.mp4 Stunned The entity is blinded and incapacitated. A big and blinding flash is produced. The affected entity retrains their mobility, but both vision and earing are temporarily lost. Knocked out The entity is knocked out. it can't move or see... A mix between paralyzed and stunned, except that everything will black out rather that light up. Statuses visual effects Each of these effects will have their own visuals to help to identify what type of effect is induced in who. If the effect is applied to the player, then a vignette effect is applied to the screen. This effect actually has a nice wavy effect among other things... Here's a video of it: wavy.mp4 When inflicted by the frozen status, the player will also see ice crystals forming on their screen, just to be fancy. If otherwise an AI is given a status, then the same pattern will be applied to it. The pattern is also screen aligned, making it really abstract. New Relics and Activated items Because statuses are now fully implemented in the game, there's now even more relics and activated items. These are directly related to statuses and give the player unique capacities like to those as well. Relics There are 4 new relics. These are all related to statuses in one way or another... Hot dreams This is an abstract representation of a sunset. It's actually quite cliché in 80s aesthetics... This relic also does billboarding. There are just some shapes that don't translate well in 3D... With this, the player is able to set entities on fire (thus giving the burning status) to attacked enemies. These attack can be direct (like a hit) or not (like a laser beam). As long as it originated from the player, it's all right. Here are its modifiers: -5% ATK +5% AGL Ice drop This is an ancient artifact resembling a raindrop. While holding it, any attack received or given will result in the other party to receive the frozen status. Here are its modifiers: +10% DEF -5% ATK Crystal Cola This is a clear cola. It's supposed to represent a Crystal Pepsi. This relic gives the Purifier capacity. In essence, it can make the player resistant to status changes. Here are its modifiers: +10% LCK -5% ATK Crystal Tea A nice tea beverage. It's a reference to Arizona green tea. It has the Purifier capacity and also speeds up attacks. Here are its modifiers: -25% ATK +25% AGL Activated Items There's only one new activated item: the Lipstick. Lipstick Alignment: Future Funk This is a lipstick. A red one in fact. While holding it, the player will experience a small growth... When activated, the item will make any hostile entities in a 25m radius receive the frenzy status. Here are its modifiers: -20% LCK Minor changes There weren't a whole lot of other changes. But the AI was considerably changed to include status effect in their behaviour (ex: stunned enemies can't spot the player or frenzied enemies will attack other enemies)... Next week There's still a lot of work on status effects. For example, not all statuses have patterns, and there's also more effects to be added and tweaked here an there. If there's anything new, it could be better props or even more specials rooms... After all, now that statuses are in, there's a lot of things that can be implemented.
  3. jb-dev

    Showing off the spatial distortion effect

    From the album: Vaporwave Roguelite

    This shows the spatial distortion effect. A video would be a better thing, but it also distorts the image with a sine wave according to time.
  4. jb-dev

    Vaporwave Roguelite

  5. jb-dev

    All foods in a row ready for debug

    From the album: Vaporwave Roguelite

    This shows most food in the game right now. Both the pineapple and the banana are currently in low LOD. I haven't had the time to configure those properly yet...
  6. Last week I've worked on two things: Foods and Activated Items. I can safely say that my goal was achieved, and even surpassed. I've managed to add three working Activated Items and a whopping 9 foods in total. So let's dive right into it. Focus system crash course Before we dive right into activated items, we first have to know about the focus system. The focus system is like the classes or specializations system in most RPGs. Except that the focus system is actually quicker and is overall much more simpler than traditional RPG class system. (Because it's in a roguelike game and permadeath exists) In essence, each time the player uses those items, then its focus will shift through three poles: Vaporwave (Rogue/Assasins), Future Funk (Marksmen) and Hardvapor (Brawler). Having a certain focus can results in additional bonuses in certain stats, and can even give weapons and other items different type of bonuses and capacities. As of right now, no actual bonuses are implemented. This is because the focus system is primarily linked to the player's equipment... These aren't in the game just yet... Activated items If you played The Binding of Isaac, then you may be familiar with this concept. The idea is to have an item that can have an effect when manually triggered. Activated items work just like this: they are items that the player can activate. Most of the time, these give additional abilities to the player, like becoming temporarily invisible. Activated items can also have relic-like capacities that apply as long as the item is held, and can also have modifiers. Items can also have a focus alignment. Right now, only three of these are functional in the game. The Cellphone Alignment: Vaporwave This is an old piece of junk. It's supposed to represent an old Motorola brick phone. With this phone, the player is able to set up a one-way teleportation trip. First, the player needs to set up an exit point by activating it. This will create a weird sphere of spatial distortion Afterwards, when the player activates the item once more, they will be instantly teleported to it. Useful when you're in a huge level and want to get back to a specific room like a mall after getting more dosh. Here are it's modifiers: -5% ATK -10% HP Survival Gear Alignment: Hardvapor This activated item is supposed to represent a survival backpack. With this item, the player can sacrifice its health for foods. Here are its modifiers: -20% AGL -10% HP This Alignment: None This is this or at least my interpretation of it. In my head, an object always was a big red specular sphere. Maybe it's because I started making games with Game Maker? Perhaps... With This, the player can reroll all items in a 25 meters radius for 10$. Here are the modifiers: +25% LCK -10% HP Foods Foods are like temporary relics. They sometimes have capacities like relics and also have modifiers that are usually out of this world. When the player eats foods then a countdown is initiated. When the countdown is finished, all modifier and capacities given to the player are removed. Right now every food lasts for about 5 seconds. This will be individually tweaked based on things like modifiers and capacities... Here's a list of foods in the game: Pineapple This is a simple pineapple. Nothing special here Here are the modifiers: -10% LCK +25% ATK +50% DEF -10 AGL Banana A normal banana. Here are the modifiers: +75% LCK +68% DEF +50% AGL Lime A normal lime, cut in half. Here are the modifiers: +10% LCK +25% ATK +75% AGL -10% HP Pineaburger A burger made of a slice of pineapple. There's also a lettuce leave thrown in there for good measure. Here are the modifiers: -10% LCK +25% ATK +50 % DEF -10% AGL Double Deluxe A plain waffle topped with whipped cream and glazed with some kind of syrup (claimed to be raspberry, but sure doesn't taste like it) Here are the modifiers: +75% LCK +10% ATK -25% DEF +10% AGL +5% HP Instant Ramen A normal instant ramen bowl. chopstick included. Here are the modifiers: +50% ATK +50% AGL -25% HP Bento box A somehow 80s bento box, with crazy shapes, lines and colours. Comes with chopsticks. Here are the modifiers: +25% LCK +10% DEF -10% AGL +75% HP Toast Sandwich A somehow plain looking sandwich. It appears to have a heavily buttered toast in the middle. This is one of the food that can give you a capacity. When eaten, it gives the capacity to do a double jump. Here are the modifiers: -10% LCK +25% DEF -50% AGL -5% HP Minor updates There are now proper debug tools, such as spawning folders and so, making the testing phase so much quicker Resolved some bugs with mall inventory not being properly chosen Finally added relic/foods/equipment/weapon spawning to folders items. This means that the player can finally get good loot from folders. Fixed an infrequent bug that gives wrong orientation to some rooms (i.e. some breakable wall used to spawn perpendicular to the rooms) Added a bunch of things to add effects like 2d drop shadows and outline rendering Next week Next week I planned to add statuses to the game. Statuses like poisoned of stunned. There's already a list of statues that was previously prepared. Now it's just a matter of implementing those. Otherwise, if I have the time I'm probably going to continue the implementations of items/capacities... I also realized that while testing things out I just forget I'm testing and I just play the game (even though there's only one unfinishable level) I genuinely had fun... I wish this feeling will get bigger as this is developed.
  7. jb-dev

    A held activable item

    From the album: Vaporwave Roguelite

    In the game there'll be activated items, Theses needs to be explicitly activated by a button press. Their effects can vary greatly. Right now, the player has the cellphone. The game shows the held item at the bottom of the screen. Both the shadows and the borders are generated through shaders, which is kind of flexible.
  8. jb-dev

    Food countdown test

    From the album: Vaporwave Roguelite

    The game will have foods that can temporary boost the player's stats for a given duration. Here I'm testing the duration formatting and also a way to display which type of food the countdown is linked with. There's even a nice little drop shadow effect to be consistent with most UI elements
  9. In my previous update, I've said that the next step would be to integrate relics in the game. I'm proud to say that I've managed to implements some of the planned relics. What are Relics? If you played The Binding of Isaac, you may recall it's Passive Collectibles. Relics are the equivalent in this game. In other words, Relics are run-scoped upgrade the player either find or (if they're lucky) buys in malls. These give stats percentage bonus (i.e. +25% bonus in attack) and also give the player special capacities. What are Capacities? Capacities are passive (i.e. not explicit, or don't need special inputs) abilities the player gain. For example, one capacity could be the capacity to shoot laser beams at each attack. There's a science to it, though. They need considerable balance tweaks here and there just to make sure the game won't break with these capacities. Some capacities are linked to relics, and others not. For example, a capacity can be linked to a specific Item or even Foods. Right now, there are no items or Food in the game, so we'll talk about those in due time... Stats crash course Before we continue with the relics, we first need to understand stats. Stats are exactly what you think they are: just like in most RPG, they quantify the skills of a given entity. In the game, there are 5 base stats : Chance (or Luck if you're fancy): This stats dictates the probability of a player to have good things happen to them (e.x. good loots spawns after an enemy is killed or a lot of special rooms and tunnels are spawned). It also dictates your chance of doing a critical hit (when so, the total damage output are 50% stronger) Attack: it's self-explanatory. This simply gives how much damage is given at each hit Defence: Also self-explanatory. This simply says how much damage is subtracted from an attack Agility: This stats dictates how fast your character goes. there might be more in the future, but for now, it only affects this Vitality (or Health if you're fancy): This stat simply represents your maximal health. These make CADAV. I don't know if it's clever enough, but it's catchy. (Not as good as SPECIAL, but good enough) For each stat, there is two different type of bonus/malus. These are a unitary bonus (or simply bonuses) and a percentage bonus (or modifiers). Bonuses usually come with pieces of equipment (things like armour and/or weapons), while modifiers are usually applied with capacities as a counterweight. Relics List Here's a small list of relics that are fully functional as of today: Laser Gem The laser gem is a relic resembling an abstract transparent cube with an opaque core. When the player picks up that relic, it gives them the ability to fire penetrating laser beams that deal damage to enemies when the player attacks. When the laser collides with anything but entities (like enemies) it will be reflected. This can be a quite powerful tool to quickly dispatch large amounts of enemies. The beam itself last for about 10 seconds, and only 3 beams can be fired at a time. Here are the modifiers: -10% of Attack +5% of Luck Modern Computing This relic is also abstract, but it's nevertheless more meaningful than the previous relic. Both its name and its model references something really vaporwave. But I'll let you figure it out. When the player grabs this relic, a combo system is activated: for every enemy killed, drops that cames from defeated enemies will linearly increase in number. Of course, being a combo system, if the player is hit then the combo is reset. Here are the modifiers: -5% of Luck -4% of Attack Credit Card The credit card is a credit card. (I didn't know what you expected) With this cool relic, the player can actually purchase anything they want anywhere even if they lack the money for it. Buying an item without the needed money creates a debt in the player's funds. After each 10$ of debt, a random amount of negative modifiers are applied to the player's stats. When the player pays off their debts then these nerfs are progressively removed. Because of this special capacity, no base modifiers are applied when this relic is grabbed. DOUBLE-VISION This relic is rather abstract. It's actually a pair of eyes. When the player grabs this relic, every loot that are consumables (i.e bombs, keys or money) are doubled. Here are the modifiers: -5% of Attack -10% of Luck +5% of Agility Extension Cord This relic is simply a North American electric extension cord. There are two capacities attached to this relic. The first one simply makes the range of your attacks bigger. Its just actually the game resizing your weapons... Nothing special here. The second one is more a nerf than anything else: It slows down your attack speed by half. Here are the modifiers: -25% of Attack -25% of Agility Boxed Copy This relic is a Software box. It's supposed to mimic the Windows 9x boxes. With this relic, on the first successful hit by the player to an enemy, the latter has a chance to get "Boxed". When being "boxed", enemies are transformed into a similar box like the relic itself. However, that box is able to be opened by the player. It then spawns a random amount of consumables. It essentially one hit enemies if your lucky and gives you loot too. This only works on the first hit: subsequential hits won't work. Here are the modifiers: -25% of Attack Atk-booster 2000 This relic is a computer chip, presumably a CPU. It simply increases your attack speed by half. Here are the modifiers: -25% of Attack +10% of Agility Watch Out! This relic is a simple watch. With this one, you gain the ability to backstab other enemies. (not unlike the TF2 backstab) This means that if you hit their back they get one hit. In essence, this works by using the same algorithm that my vision field Here are the modifiers: -40% of Attack -25% of Health +5 of Agility Minor Updates Items that are in malls, along with relics and pieces of equipment, now rests on pedestals. These get removed when the item is picked up or otherwise get removed There's now a key collectible that can spawn with any type of loot. Picking these up simply increments the player's total amount of keys The Big Mall (the generic one) now has a chance to spawn a buyable relic in its inventory Fixed many bugs with a whole lot of things Thrown items now properly trigger AIs: they will look at the player that has thrown said projectiles rather than the projectile itself What's next? This week I'm planning to add more capacities and maybe add either Foods or Items in the game. Same goal as before: at least one Food or Item. Just to be clear: Items are like The Binding Of Isaac's Activated Collectibles except that they also change the player's stat and may also add passive capacities while the item is being held. As for food, think of relics, but temporary (a bit like Minecraft's potions). Here comes another big week I guess...
  10. jb-dev

    Items in a mall on pedestals

    From the album: Vaporwave Roguelite

    Now items that are for sales in shops like are resting on greek vaporwave like pedestals. These are removed when said item is either picked up or, in this case, bought. Those pedestal also appear under treasure-like items (i.e. items containing multiple items) Also, most relics have them too. When the player beats a boss, the dropped relic will have a pedestal under it.
  11. jb-dev

    Relics aligned for debugging

    From the album: Vaporwave Roguelite

    From left to right : Electronic Mask Experience a whole new level of calmness with the Electronic Mask. Everything in your life will become clearer and less confusing. Ice Drop An ancient artefact. It looks like a crystal, but in the shape of a raindrop... It's cold to the touch.. Watch Out! A wise man once said to watch out your back... You'll never know what's gonna happen. Boxed Copy Look at it: pristine condition! Never open! Better check online how much its worth... Backup Floppy Don't get caught with your pants down! Please make regular backup using this sassy floppy. You could even save yourself in it! These relics are in a general debug area. Usually you'll never find these lined up like that.
  12. jb-dev

    A Clothes Mall

    From the album: Vaporwave Roguelite

    Clothes Mall specialized in wearables. Clothes, jewellery and all matter of accessories. In other words. it's an equipment store.
  13. jb-dev

    A Blood Mall

    From the album: Vaporwave Roguelite

    Blood Malls sells items that can easily make a bloody mess. In other words, it's a weapon store.
  14. jb-dev

    Looking at a locked door

    From the album: Vaporwave Roguelite

    These doors guard specials rooms. Those rooms can give the player unique opportunities and really help a player when faced by a bad run.
  15. jb-dev

    Money sparkling effect

    From the album: Vaporwave Roguelite

    The money items are currently really small and can easily be missed. In order to help with that, I've added a sparkling effect to most money items. Some of these particles are emitting lights. I hope that in this way those items get more noticeable. Otherwise, I could make them bigger...
  16. I've decided to change the frequency of these updates: most of the times, I just do some minor updates and graphical tweaks here and there. Therefore, if I do these updates weekly, then I'll have a lot more content to write about. So, yeah... Last week, I've been working on adding many different types of rooms in the level. You may or may not know that I use BPS trees to generate a level, and previously, only 5 types of rooms spawned in a level: starting rooms, ending rooms, normal rooms, tunnel rooms and Malls. It was very static and not flexible, so I've changed it to make it more dynamic. Malls Variations First, I've added two different variations for Malls: Blood Malls and Clothes Malls. These were originally planned and already built. Big Malls These are your typical type of Malls. You can find everything here. This is where, for example, you'll find hearts, keys and/or bombs. They were already in the game, but now they're more specialized (or generalized in this case) Blood Malls The Blood Malls specialized in bloody activities. (meaning that you'll mostly find a selection of weapons here) Clothes Malls The Clothes Malls are specialized in clothes, which in our case are actually pieces of equipment the player can have New Rooms Aside from these new type of malls, I've also added 3 new types of rooms. These rooms, however, are guarded by a locked door: the player must use a key to enter. In order to unlock a locked door, the player just needs to touch it. If the player has enough keys, then a key is used and the locked door disappears. There's also an event that triggers that can do things when the player unlocks the door (like revealing hidden models and what not) The Gym The gym is a room resembling some of these outside gyms you can see in some places. The player can use up to tree gym equipment to get a permanent stats bonus to a randomly selected stat. The prices of usages of these gym equipment doubles after each use. (i.e. if using one piece is 10$, then after buying it the others will cost 20$ and so on) I've planned that NPC would use non-interactive gym workstations for decoration, but it's not really important as of right now... The Bank The bank is not fully functional at the moment, but it still spawns. The idea is to give the player a way to store money persistently throughout runs. The player can then withdraw money (with a certain transaction fee) from that bank. That means that you can effectively get previously deposited money back when you'll need it the most. The Landfill The landfill gives you the opportunity to gain back previously thrown away pieces of equipment. Basically, the game stores the last three thrown away pieces of equipment. When the rooms spawn, it simply displays you those pieces of equipment. you can then pick them up for free. This, however, comes with a caveat: pieces of equipment that will be switched from a previously thrown away pieces of equipment won't reappear in another landfill. Also, once the landfill despawns, the items in that landfill will be discarded. (Think of it as a last chance opportunity) There aren't any props at the moment, but it's fully functional. Minor Tweaks Aside from that, there are also some minor tweaks: Bombs now damage the player if the latter is within its blast radius; Player jumps are now more precise: letting go of the jump button early makes a smaller jump than if it was held down longer; Ground detection (that was previously done with raycasting) now uses Unity's CharacterController.isGrounded property; When the player is hurt, a knockback is applied to him; The strength of said knockback is actually the total amount of damage the player took. Coins and money items now emit particles to help the player localize those important items; They're now keys (left) and bombs (right) counters in the HUD; The key one still needs a specific icon, but it's fully functional; There were many shader optimizations and adjustments: Many shaders were merged together and are now sharing most code; I've also changed the shaders so that we can use GPU instancing for most props, I also now use MaterialPropertyBlock for things like wetness; Also, now the palette texture and its palette index are now global variables, this effectively means that I only need to set these values once and everything else follows; A small "Sales" sign is placed in front of most types of malls. This sign has a random orientation and position each time it's spawned. ; Props that obstruct a passage are removed from the room; This way no prop can obstruct the room so that the player cannot exit it. Some rooms now spawn ferns instead of palm trees; Lianas also have different configurations based on which prop spawns. Next week Over the next week, I've planned to integrate the first relic. Relics are items that give the player capacities and stats boosts. It's common to have something similar in most roguelite and roguelike games. That type of thing needs to have a good abstraction in order to work: there are many different types of capacities that affect the player in radically different ways. There's a lot of work ahead. But I'm confident it'll be easy. Just need to get in the groove.
  17. jb-dev

    A little sign infront of a mall

    From the album: Vaporwave Roguelite

    This little sign is actually placed randomly and at a random angle. There can only be one though. Much like all other models, it follows a colour palette.
  18. jb-dev

    Let's go to the gym

    From the album: Vaporwave Roguelite

    Let's hit the pipes!!! For a reasonable cost, the player can gain a permanent random stats bonus when selecting those dumbbells over there, on the mat. But each time the player uses a dumbbell it disappears afterwards and the cost of the others dumbbells are doubled.
  19. jb-dev

    Let's go to the bank II

    From the album: Vaporwave Roguelite

    This is a more complete version of the bank. Now there are nice lights that make it look good.
  20. jb-dev

    Let's go to the bank

    From the album: Vaporwave Roguelite

    This is a picture of a yet to be completed bank. The idea is to generate simple geometries to fill the space between the floor and the ceiling. It's done like that because I can set the wall height of the generated level on the fly, so I need something generic and flexible.
  21. Today was kind of a slow day too. I've haven't got a lot of sleep lately (thanks little hamster wheel in my head) But at last, I was still able to add (and also fix) some graphical components here and there. In short, I've made the first and last rooms of the level more distinct from every other room. For example, I've added a room flow on these rooms to properly align props and, in the case of the starting room. the spawning rotation. I've also added a little decal-like plane that tells the player what to do (take it as a little tutorial, if you may) The important thing is that this decal is, not unlike my palette shader, dynamic in terms of colours. What I've done is quite simple: I've mapped each channel of a texture to a specific colour. Here's the original texture: After inputting this texture in my shader, it was just a matter of interpolating values and saturating them: Shader "Custom/TriColorMaps" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _Glossiness ("Smoothness", Range(0,1)) = 0.5 _Metallic ("Metallic", Range(0,1)) = 0.0 _RedMappedColor ("Mapped color (Red channel)", Color) = (1, 0, 0, 1) _GreenMappedColor ("Mapped color (Green channel)", Color) = (0, 1, 0, 1) _BlueMappedColor ("Mapped color (Blue channel)", Color) = (0, 0, 1, 1) } SubShader { Tags { "RenderType"="Transparent" } LOD 200 CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard fullforwardshadows vertex:vert decal:blend // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 sampler2D _MainTex; struct Input { float2 uv_MainTex; }; half _Glossiness; half _Metallic; fixed4 _RedMappedColor; fixed4 _GreenMappedColor; fixed4 _BlueMappedColor; void vert (inout appdata_full v) { v.vertex.y += v.normal.y * 0.0125; } // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. // #pragma instancing_options assumeuniformscaling UNITY_INSTANCING_BUFFER_START(Props) // put more per-instance properties here UNITY_INSTANCING_BUFFER_END(Props) void surf (Input IN, inout SurfaceOutputStandard o) { // Albedo comes from a texture tinted by color fixed4 c = tex2D (_MainTex, IN.uv_MainTex); c.rgb = saturate((lerp(fixed4(0, 0, 0, 0), _RedMappedColor, c.r) + lerp(fixed4(0, 0, 0, 0), _GreenMappedColor, c.g) + lerp(fixed4(0, 0, 0, 0), _BlueMappedColor, c.b))).rgb; o.Albedo = c.rgb; // Metallic and smoothness come from slider variables o.Metallic = _Metallic; o.Smoothness = _Glossiness; o.Alpha = c.a; } ENDCG } FallBack "Diffuse" } Also, note that I've changed the vertices of the model. I needed a way to eliminate the Z-Fighting and just thought of offsetting the vertices by their normals. In conclusion, It's nothing really special, really. But I'm still working hard on this. EDIT: After a little bit of searching, I've seen that you can give a Z-buffer offset in those Unity shaders by using the Offset state. So I've then tried to change a bit my previous shader to use that functionality rather than just offsetting the vertices: SubShader { Tags { "RenderType"="Opaque" "Queue"="Geometry+1" "ForceNoShadowCasting"="True" } LOD 200 Offset -1, -1 CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Lambert decal:blend // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 sampler2D _MainTex; struct Input { float2 uv_MainTex; }; fixed4 _RedMappedColor; fixed4 _GreenMappedColor; fixed4 _BlueMappedColor; // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. // #pragma instancing_options assumeuniformscaling UNITY_INSTANCING_BUFFER_START(Props) // put more per-instance properties here UNITY_INSTANCING_BUFFER_END(Props) void surf (Input IN, inout SurfaceOutput o) { // Albedo comes from a texture tinted by color fixed4 c = tex2D (_MainTex, IN.uv_MainTex); c.rgb = saturate((lerp(fixed4(0, 0, 0, 0), _RedMappedColor, c.r) + lerp(fixed4(0, 0, 0, 0), _GreenMappedColor, c.g) + lerp(fixed4(0, 0, 0, 0), _BlueMappedColor, c.b))).rgb; o.Albedo = c.rgb; // We keep the alpha: it's supposed to be a decal o.Alpha = c.a; } ENDCG }
  22. jb-dev

    A ragdoll on the floor

    From the album: Vaporwave Roguelite

    This ragdoll is about to be shrunken to nothingness soon enough...
  23. During the past days, lots of shaders were updated and other visual things did too. Firstly, I've added lights effects when the crystals get shattered. There's also a burst of particle emanating from the broken crystal on impact. Also, enemies now leave a ragdoll corpse behind when they die. I love some of the poses those ragdolls make. On another note, I've toyed around with corpse removal and got captivated by the shrinking effect it created. It can sometimes be off-putting, but I'm still captivated. I've also added a nice VHS-like effect from layering two VHS shader together; namely "more AVdistortion" and "VHS pause effect". I've already ported the former and it's already active and the latter was just a matter of porting GLSL shaders to HLSL. No biggie. I did change the code a bit to make the white noises move through time. And there's nothing like trigonometry to help us with that fixed4 frag (v2f i) : SV_Target { fixed4 col = fixed4(0, 0, 0, 0); // get position to sample fixed2 samplePosition = i.vertex.xy / _ScreenParams.xy; float whiteNoise = 9999.0; // Jitter each line left and right samplePosition.x = samplePosition.x + (((rand(float2(_UnscaledTime, i.vertex.y))-0.5)/64.0) * _EffectStrength ); // Jitter the whole picture up and down samplePosition.y = samplePosition.y + (((rand(float2(_UnscaledTime, _UnscaledTime))-0.5)/32.0) * _EffectStrength ); // Slightly add color noise to each line col += (fixed4(-0.5, -0.5, -0.5 , -0.5)+fixed4(rand(float2(i.vertex.y,_UnscaledTime)),rand(float2(i.vertex.y,_UnscaledTime+1.0)),rand(float2(i.vertex.y,_UnscaledTime+2.0)),0))*0.1; // Either sample the texture, or just make the pixel white (to get the staticy-bit at the bottom) whiteNoise = rand(float2(floor(samplePosition.y*80.0),floor(samplePosition.x*50.0))+float2(_UnscaledTime,0)); float t = sin(_UnscaledTime / 2); if (whiteNoise > 11.5-30.0*(samplePosition.y + t) || whiteNoise < 1.5-5.0*(samplePosition.y + t) ) { // Sample the texture. col = lerp(tex2D(_MainTex ,samplePosition) , col + tex2D(_MainTex ,samplePosition), _EffectStrength); } else { // Use white. (I'm adding here so the color noise still applies) col = lerp(tex2D(_MainTex ,samplePosition), fixed4(1, 1, 1,1), _EffectStrength); } return col; } It's nice to have HLSL code, but a video is better:
  24. jb-dev

    Ragdoll removal tests

    From the album: Vaporwave Roguelite

    It's just me trying out ways to remove ragdolls from the world.
  25. After thinking about it, I've could have gone with deferred decals, but I thought i didn't need that right now: most of my geometries are flat at the moment...
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!