Jump to content
  • Advertisement

Entry #4 Testing Deform on the Project

Antonio Schwuchow

899 views

Some days ago the developer of this tools posted this on reddit 

 definitely should check out.

 

For the project, the vaporwave mode activates when tha player reaches the maximum capacity on the bus and keeps adding passenger for it. The idea was to "spherify" the bus as it was being overcrowded, but there wasnt any solution to this other than lerping a custom animation, which i could do eventually but would take some time since im not used to animating things. So now we can use Deform, im just starting experimenting with it. For the voxel object it doesnt look smooth but im already satisfied.

9LC8cv65PE.gif.fd171d09e84f4c8ab2445e1b83c47a60.gif9LC8cv65PE.gif.accc17ecdc47c7fd997f67ffd354cbb3.gif



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Ruben Torres
      [This article was originally posted at The Gamedev Guru's Blog]
      I normally do not share my past struggles, but this topic deserves it. What to do when you lose hope with Unity UI?
      I still remember that weekend, about five years ago...
      I spent the entire weekend worried about all the technical debt I was accumulating over the months in one of my projects. I had done things too quickly, without really understanding them. Clearly enough, that had to stop working at some point.
      The thing is, I owed my clients results but I had no idea how to bring them. That morning though, I said to myself: Rubén, this is enough. Stop the excuses. You are becoming a professional today.
      So, I decided to gather every single resource I could find about user interfaces in Unity, because that was the biggest hurdle I was dealing with for several weeks. I read forums, best practices, Unite videos, read all blogs I could find on that topic and did my own research.

      Did you ever experience this feeling of slowly getting overwhelmed by technical debt? It accumulates over time and someday you either give up or decide to crush it. In my case, it was the later.
      You probably heard that optimizing UI in Unity is challenging. Or, if lucky, you know it from first-hand experience. Yes, Unity UI is a powerful tool and I love it. However, its mightiness can quickly transform into a deadly weapon if it falls into inexperienced hands. And so were my hands back then.
      If I had to confess anything to you today, it would be this: I wished I had had a solid foundation on Unity UI before I designed the UI of several games.
      It is SO easy to do it wrong, SO easy to get frustrated. In my opinion, there's something even easier than that. That is, for your client to ask you to do over-hours to get your shit together.
      In my experience in the professional sector, companies do not want developers who design poorly optimizable interfaces and leave the tuning task to experienced programmers. They rather want developers who create visually stunning interfaces, but also performant.
      And even in the indie development scene, where would you choose to spend your time on? Bringing fun to your players, or spending hours clicking through the profiler to find bottlenecks?
      In my opinion: no matter your role, you should understand basic Unity UI design principles. But this takes time and project experience. You might not have any of these.
      Hopefully, I can help you there.
      Today, I will give you one of my most powerful tools:
      The Guru's UI Development Diagram
      As usual, I'd like to start with the Level 1 Developer construct
       
      Level 1 Unity UI Developer: UpdateBatches & Layout Spikes in Unity UI
      Level 1 Unity UI Developer: free-style UI
      This is where we all start: free-style design, free-style results.
      I used to import sprites with whatever settings. Then, I would add them as images everywhere with no predefined criteria. And so I ended up with an unstructured hierarchy full of components that I didn't need. I used the wrong systems for the wrong reasons.
      Overlapping UI elements, a motherload of batches, profiler spikes. Those are all common.
      Do I have anything against this?
      Partially. I think it is great to play around and to make mistakes. Breaking and repairing help learning.
      But if you want to do this for a living, at some point you might want to level up your skills and embrace professionalism.
      This becomes unacceptable in the games industry, especially in Virtual Reality. If you do this in VR you will turn players into patients.
      Such a chaotic Canvas hierarchy structure could look like this:

      Level 1 Unity UI Developer: Unstructured Unity UI Hierarchy
      You do a lot of nesting, you use auto-layout components everywhere and there is a lack of rules.
      At some point, someone will ask you to optimize your UI. That could be your players, your boss or even your own pride.
      But you might not be ready for this. You might be caught off-guard having other tasks on your plate. And UI development is daunting at the beginning.
      The reason for its complexity lies in the amount of factors it involves. Leaving the visual appeal aside, you can say that the way you work with Unity UI will have a big impact in three critical hardware pieces: the CPU, the GPU and the developer theirself.
      If you are lost, it's good, because...
      I am about to show you something cool
      Let's level up as a developer!
       
      Level 2 Unity UI Developer: The Guru's UI Development Diagram
      Level 2 Unity UI Developer: The Guru's UI Development Diagram
      Here we are with a Venn Diagram. I decided to call it The Guru's UI Development Diagram.
      There we see three big chunks related to Unity UI Optimization: CPU, GPU, and Developer. Those are the main resources you will have to spare when developing UI.
      I want to give you a short overview before we start digging into the topics.
      You pay the CPU toll mainly when generating and submitting batches of UI. You can think of them as UI components, such as images. The more of those you have, the more strain you will put in your processor.
      The turn for the GPU. You pay the GPU resources mostly in concept of overdraw. This means, stacking layers of graphics on top of each other.
      Lastly, the developer's pain is paid in time. You spend time every time you design or maintain your UI. Unity offers you some tools to make it easier for you, e.g. auto-layout helpers.
      The cost of the three components rely mostly on you, but they sometimes counteract each other. It's very challenging to perform in every aspect, unless you are very experienced and you have the right tools.
      Eventually, you will get there.
      I would like you to have a closer look at the attached Guru's UI Development Diagram.
      You might be confused. That's alright because we are going to cover each section separately. You will get to understand all of it.
      For now, you only have to understand one thing: in the end, it will be up to you to find the balance between the three variables in your game.
      Before we start with each component, have a look at these general rules:
      The easier you want the UI design workflow to be, the less performant your UI will be. If you want more GPU performance, you will have to focus on finely tweaking graphical elements and avoid element stacking. For more CPU performance, you will need to reduce the amount of graphical elements present in the hierarchy. Let's move on, I can't wait to show you the CPU side of Unity UI Optimization!
       
      Level 2 Unity UI Developer: The CPU
      Level 2 Unity UI Developer: The CPU
      In my opinion, this is very simple.
      The golden rule is:
      Every time you add a UI component in your scene, you are adding CPU overhead
      Each component increases the CPU cost for the following reasons:
      RectTransform calculation: this is pretty much free in simple canvas hierarchies. However, your CPU will have a harder time if you are using auto-layout components to ease your UI design workflow, such as vertical layout groups and such. The issue with those is that most RectTransforms present in the hierarchy will now depend on each other, so the calculation becomes more complex. Vertex generation: the GPU understands vertices, thus those must be provided by the CPU. Vertices must be generated based on the entire canvas hierarchy of the involved RectTransform elements. The vertices depend as well on the specific type of UI element you added (images, texts). Under this category, we also include the cost for the CPU to add other per-vertex attributes such as colors and UVs. Dynamic batching: because draw calls are expensive, Unity does its best to dynamically batch as many of them as possible.
      Think of this as combining a large number of small groups of vertices into a single, huge group of vertices. Because... would you rather go to the supermarket ten times to bring an apple each, or go just once and grab them all together?
      Batching is, however, an expensive operation for the CPU which increases with the amount of UI elements you have. Draw call emission: finally, the generated batches must be sent to the GPU. These graphical processing units are very picky with the data formats they accept, so the CPU has to make extra work to pack them in a way that they like. This is expensive, yes. But luckily for us, Unity is kind of smart and caches the canvas so these expensive processes do not happen in every frame.
      Just as I brought you good news, I will give you the bad ones: this cache is super easy to break.
      Changing almost any attribute of any UI element will break the cache of your canvas. If that happens, we go through most of the process again. These changes, by the way, trigger what is called a canvas rebuild.
      I'll give you some examples of the breaking changes: scaling, positioning, rotation, color, image swapping, animations and more.
      After exposing the basics, I want to conclude with three practical observations:
      The more elements you have in your Unity Canvas, the more CPU overhead you will have on each canvas rebuild. Avoid any kind of changes in UI to avoid canvas rebuilds. If needed, then put dynamic elements in different canvases. Canvases are either static or dynamic. Design accordingly.  
      Level 2 Unity UI Developer: The GPU
      Level 2 Unity UI Developer: The GPU
      Now is the turn for the friendly Graphical Processing Unit, don't you think?
      The GPU is the piece of hardware that makes us fall in love with games. We owe them so much. What about showing it some affection? Well, we can...
      By treating it well.
      But guess what? UI can make the GPU pretty upset. Especially mobile GPUs, where it is relatively easy to be memory-bound. To put it simply:
      In mobile, there is a massive reason UI is expensive: overdraw!
      Overdraw happens when we render the same pixel multiple times per frame. And this is soooo easy to achieve with Unity.
      Every time to add a Unity UI Image, you are commanding your GPU to draw a full rectangle, rendering every single pixel inside that rectangle. And it does not matter if the pixel you are drawing is transparent, it will cost you still.
      That means, I advise you to be careful with the transparent regions of your sprites!
      This has some implications for you. If you add 10 full-screen images, then you get 10x overdraw. As my grandmother used to say, WTAIWYG! (What You Add Is What You Get).
      Stacking of layers on top of each other will slowly enrage your GPU. It will add milliseconds to it, which is a crime in VR games where your budget could very well be under 13ms.
      I do not want to get too technical in this post... but I can't just help it! Some day you will be having a delicious coffee break conversation with your colleagues and you might feel tempted to drop a few intellectual lines. If that's the case, say this one aloud:
      UI Overdraw is expensive in mobile because you devour the precious memory bandwidth of the device and this is further worsened by the alpha blending happening internally
      You'll make some jaws drop.
      The key lesson is easy: avoid stacking UI elements on top of each other and you will be fine 
      GPU cost mainly comes from stacking graphical layers on top of each other. Avoid these. Reduce the space UI takes in screen to reduce GPU cost. Implement sprite atlasing to improve CPU and GPU performance.  
      PRO TIP #1: Sprite Atlasing (opens in a new tab)
      PRO TIP #2: Opaque UI Shading (opens in a new tab; Advanced)
       
      Level 2 Unity UI Developer: The Developer
      Level 2 Unity UI Developer: The Developer!
      I am afraid we often under-estimate the effort required to design, implement and especially maintain optimized user interfaces in Unity.
      Surely, Unity improved in this area during the last few years and now it is easier and faster than ever to create those. But this comes at a cost.
      In general, the more Unity UI extras you use, the worse your game will perform.
      The auto-layout helpers are especially expensive. Unfortunately, they are the most helpful. For instance, I find Vertical Layout Groups especially handy when designing responsive UI. These neat scripts help you organize your elements in a manner that is structured and therefore visually appealing.
      The problem I see with those is that they incur on a big CPU cost whenever there are canvas rebuilds!
      You might be able to get away with UI helpers if your UI is static 99% of the time, but the frame it isn't, you will notice it.
      We love working with helpers, but we don't want to ruin our performance. Here's one trick you can try: keep the auto-layout helpers around while designing but disable them all just before saving your scene. By doing this, they will be deactivated for run-time players, but they already did their work for you!
      I don't want to disappoint you, so just remember that this auto-layout disabling secret will not work if your UI content is dynamic.
      At the end of the day, the more tasks you delegate to Unity, the more work your hardware will have to do.  Find your own balance here! You can start using those helpers but be ready to remove them if you have to.
      While optimizing, do the biggest gains for the buck first. Only advance in the ladder of diminishing returns if the profiler tells you that you have to.
      For instance, creating sprite atlases is easy and will bring you good fortune. Tweaking graphics to avoid transparent regions, however, is more time-consuming. Lastly, creating your own UI shaders might bring you big gains but at a big cost.
      Remember, saving a few microseconds in your game might not be worth if it costs you weeks of your life-time and your application does not need it. This should not be taken as an excuse to never care; optimizations in the future are more expensive than in the present.
      Profile before you optimize Keep profiling Go for the biggest gains for the buck first  
      Level 3 Unity UI Developer: The Guru's UI Development Diagram
      Level 3 Developer: The Sweet Spots
      From the Venn Diagram, you might see several sweet spots where you could find yourself in: Fine-Grained UI Development, Coarse-Grained UI Development, Massive PP and Balance.
      They sounded quite obscure to me at the beginning, but then, with time, it all started to make sense to me. Experience brought understanding.
      What I still hold true is that, the more tools you know, the better. This is the main way I am able to recognize the subtle patterns in all problems. And, when you recognize the heart of the challenge, you know which tool to take out of your toolbox.
      Nothing will help your team more than having a developer possessing both a high-level overview of UI and an eye for detail.
      A Level 3 developer would confidently answer important practical questions that only come through experience. I can think of a few that any client could ask you:
      Here's a UI architecture for you. How performant is it? What are 3 alternatives I have to optimize this user interface? Can you show me numerical proof?
        You see, I prepared a few Unity examples for you.
      The examples you will have access to illustrate each of the UI optimization methods I propose.
      Not only that, I analyzed them all so you can feel safe the information is accurate.
      Because... do you know what comes after speaking out of our gut feelings? Speaking with certainty, based on real experience.
      So, are you serious about becoming a Level 3 Unity UI Developer?
      ---> Grab Now the Level 3 Guide from my Blog Post.
    • By Data7 Games
      Project Name: Rift One
      Role Required**: (Language - C#)
      - Dedicated Unity Programmers
      My Role: Project Lead
      Previous Projects: N/A
      Team Size: 6
      Project Length: n/a
      Compensation: Rev-share until we get funding.
      Responsibilities: 
      - Must know Unity. 
      - Must Know How Gitlab & Sourcetree work
      - Advanced Programming.
      - Friendly and chilled
      Project Description: An Sci-Fi FPS based in a alien world, where you, mark maxin are forced to enter a portal that transports you to another world.
      **Contact**: please Email us at data7games@gmail.com
    • By Guy Fleegman
      Graphic Artist Opportunity
       

       
      If you’re an artist and have ever thought about game development, but were hesitant about actually doing it, this is the perfect opportunity for you. There’s no commitment and moderate pixel art skills are probably all you need to bring to the table.
       
      Cube Universe is a game that has been in development for 5 years. It has combat, crafting, world building, quests, RPG skills and abilities, travel between planets and it’s multiplayer… it’s a fully functional game with a dedicated developer behind it all. It’s a science fiction, fantasy sandbox game where magic and technology meet. It’s alien and mystical. There’s no limit to what can be in the game and that means a lot of room to express yourself as an artist.
       
      When I say pixel art skills are required for a 3D game, let me explain the current process of how content can be created in Cube Universe.
       

       
      Cube Universe comes with a built-in editor. It allows you to build structures (like a house, a castle, a spaceship, or a sacrificial temple to the moon god of a primitive culture) using the game world’s terrain blocks (which you can also create different kinds of). It also features a modeller that allows you to create more intricate furniture, lively creatures and decorations (like a fireplace, a holographic console, a bookshelf, or a laboratory table bubbling with the craziest potions imaginable).
       
      Note: A terrain block is 0.5 metres cubed. When modelling, a 0.5 metre block is 16x16x16 voxels. Each voxel allows for 4x4 pixels on each face.
       

       
      It’s all about speeding up the process though; getting your ideas into the game world as quickly as possible. Cube Universe’s editor can import MagicaVoxel ( https://ephtracy.github.io/ ) models and it keeps the color information for texturing. MagicaVoxel is an amazingly simple and powerful voxel modelling/coloring tool that’s completely free to use.
       

       
      The next step is to add minor details through the Cube Universe editor using it’s built-in paint tools. You can import your own palette and paint until you’re satisfied. At this point everything is kept simple on purpose because the texture can now be imported into your preferred paint program as a PNG file.
       

       
      In this case, GIMP ( https://www.gimp.org/ ) is being used to change colors faster and paint the wood grain. It’s easy to see how the sides of the model are represented in the PNG file, but this process might require you to go back and forth a bit between GIMP and the editor to texture around corners and such. After you’re satisfied, you can run any filters in GIMP over your textures and you’re done!
       

       
      The nice thing when creating content is that the game supports shadows and ambient occlusion, which creates a darkening around seams and let’s you keep your textures simple while the game adds shading. The most time consuming part of the process is usually the texturing. A 30 minute model could typically take 2 hours to texture, for example. The focus of this game’s graphics is to create content easily with a pleasant appeal. The texture style is purposely simple to keep things as economical as possible. The modelling is where you want to spend the most time being creative and I believe that focus will make for an enjoyable experience creating content for Cube Universe.
       

       
      Once you have a handle on static models, Cube Universe’s editor also exports bones, meshes and UV maps to Blender ( https://www.blender.org/ ) for animation all in a DAE (Collada) file. Animation is it’s own thing and we’d love to have someone who is familiar with basic Blender bone animation, but that is not a prerequisite for this recruitment phase. This is how the creatures are animated though. And you can only model so many tables and teleporter pads before you get the itch to try making a wild half-monster, half-robot abomination that strikes fear into the player from a 100 metres away. This is what drives artists to learn more technical things; torturing the player creating engaging experiences for the player.
       
      At the end of the day, that’s what game development is about; learning new skills, pushing yourself a little out of your comfort zone and making wild ideas into a digital reality. I’ve written this recruitment post from my own perspective with the project. I’m not an experienced game artist, but I’m having a blast making stuff and learning new techniques. I’ve even learned new things about the software I thought I was already familiar with. And that’s where the fun in development comes from. Also, you won’t be alone. This is a team effort and helping each other is a crucial part of that. We'll help you get started and share any tips and tricks with you to make your life easier on this project.
       
      If you’ve made it this far, you’re definitely wondering about payment. At this point, all that can be offered is revenue sharing. If you are looking at this as an opportunity to retire on a tropical island, you’ll most likely be disappointed. If you view this as a way to experience 3D game development in probably the most accessible way possible, then I believe you’ll enjoy your time on the project. You’ll receive a copy of a cool sandbox game and some money when sales are made down the road. The details can be discussed further with the developer directly.
       
      You’ve probably noticed that all the software an artist needs is free to download. Got a computer? You’re good to go! The developer is passionate about this game and has implemented a lot of features in the editor to accommodate speed and flexibility for you, the artist. Discord messaging is the primary way to communicate and stay connected to the project. Google Drive is used for all file sharing and asset backup. That’s all the online accounts you require to join the team and start creating.
       
      Currently the game is for sale on the official website ( https://www.beosar.com/games/cubeuniverse/ ), but it’s not quite ready for a marketing push yet. With sandbox games, content is king and Cube Universe needs your help. If you’re new to game development, you'll gain some important skills and experience to help you with future endeavors. If you know someone who might be interested in the graphic side of games, please mention this opportunity to them and let them decide if this is right for them. Lastly, if you know all this stuff already and have lots of experience, well let’s see what you got, tough guy! C’mon, I dare you! 😉
       
      Feel free to ask questions in this thread. Otherwise, you can contact Beosar ( https://www.gamedev.net/profile/221978-beosar/ ) here on GameDev.net for further information. If you prefer Discord, Beosar#8149 is what you'll need.
       
       
    • By Dimitris Georgantis
      Mystery Me
       
       
      Play now! For Free. This game is made by one person with only 1 year of self taught experience. Normally the game needed 2+ years of work to finish!! However I spent 8 months on the game and made something to see your thoughts on my try for something different in terms of how you progress in game and evolve based on your feedback.I don't get any money for that and it would be a pleasure that at the end of the day the game takes a lot of feedback so I will know where to improve and happily continue doing what I love.
      Download the Game
      Itchio:https://geo-games.itch.io/mystery-me
      Discord Server : https://discord.gg/yQ6Duwg
      Website : https://www.geogames.gr/
      Facebook Page : https://www.facebook.com/Geo-Games-178252663129417/
      Twitter : https://twitter.com/GeoGames14
      Youtube : https://www.youtube.com/channel/UCjz48A
      Release Trailer: 
       
    • By MatsK
      I'm unable to find my TerrainTypeSampler when I try to call it from my code! Why?
      struct VertexToPixel { float4 Position : POSITION; float4 Color : COLOR0; float LightingFactor : TEXCOORD0; float2 TextureCoords: TEXCOORD1; //texture2D Texture : TEXTURE; //TODO: Figure out how to change the texture used for the current vertex. }; struct PixelToFrame { float4 Color : COLOR0; }; float4x4 xView; float4x4 xProjection; float4x4 xWorld; float3 xLightDirection; float xAmbient; bool xEnableLighting; bool xShowNormals; //------- Texture Samplers -------- texture2D xTexture; SamplerState TextureSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D TerrainType; SamplerState TerrainTypeSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D Grass; SamplerState GrassSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D Rock; SamplerState RockSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D Sand; SamplerState SandSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D Snow; SamplerState SnowSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture2D Water; SamplerState WaterSampler { magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; //------- Technique: Textured -------- VertexToPixel TexturedVS(float4 inPos : POSITION, float3 inNormal : NORMAL, float2 inTexCoords : TEXCOORD0) { VertexToPixel Output = (VertexToPixel)0; float4x4 preViewProjection = mul(xView, xProjection); float4x4 preWorldViewProjection = mul(xWorld, preViewProjection); Output.Position = mul(inPos, preWorldViewProjection); Output.TextureCoords = inTexCoords; float3 Normal = normalize(mul(normalize(inNormal), xWorld)); Output.LightingFactor = 1; if (xEnableLighting) Output.LightingFactor = saturate(dot(Normal, -xLightDirection)); return Output; } PixelToFrame TexturedPS(VertexToPixel PSIn) { PixelToFrame Output = (PixelToFrame)0; float4 Color = TerrainType.Sample(TerrainTypeSampler, PSIn.TextureCoords); float4 GrassClr = float4(0, 255, 0, 255); float4 RockClr = float4(255, 0, 0, 255); float4 SandClr = float4(255, 255, 0, 255); float4 SnowClr = float4(255, 255, 255, 255); float4 WaterClr = float4(12, 0, 255, 255); float4 Diff = Color - GrassClr; if (!any(Diff)) Output.Color = tex2D(GrassSampler, PSIn.TextureCoords); Diff = Color - RockClr; if (!any(Diff)) Output.Color = tex2D(RockSampler, PSIn.TextureCoords); Diff = Color - SandClr; if(!any(Diff)) Output.Color = tex2D(SandSampler, PSIn.TextureCoords); Diff = Color - SnowClr; if(!any(Diff)) Output.Color = tex2D(SnowSampler, PSIn.TextureCoords); Diff = Color - WaterClr; if(!any(Diff)) Output.Color = tex2D(WaterSampler, PSIn.TextureCoords); Output.Color = tex2D(TextureSampler, PSIn.TextureCoords); Output.Color.rgb *= saturate(PSIn.LightingFactor + xAmbient); return Output; } technique Textured_2_0 { pass Pass0 { VertexShader = compile vs_4_0_level_9_1 TexturedVS(); PixelShader = compile ps_4_0_level_9_1 TexturedPS(); } } technique Textured { pass Pass0 { VertexShader = compile vs_4_0_level_9_1 TexturedVS(); PixelShader = compile ps_4_0_level_9_1 TexturedPS(); } }  
      When I'm calling this, TerrainTypeSampler returns null!
      public void Draw() { Matrix WorldMatrix = Matrix.CreateTranslation(-m_TerrainWidth / 2.0f, 0, m_TerrainHeight / 2.0f); m_Effect.CurrentTechnique = m_Effect.Techniques["Textured"]; m_Effect.Parameters["TerrainTypeSampler"].SetValue(m_TerrainType); m_Effect.Parameters["GrassSampler"].SetValue(m_Grass); m_Effect.Parameters["RockSampler"].SetValue(m_Rock); m_Effect.Parameters["SandSampler"].SetValue(m_Sand); m_Effect.Parameters["SnowSampler"].SetValue(m_Snow); m_Effect.Parameters["WaterSampler"].SetValue(m_Water); //m_Effect.Parameters["TextureSampler"].SetValue(m_Grass); m_Effect.Parameters["xView"].SetValue(m_CController.View/*m_ViewMatrix*/); m_Effect.Parameters["xProjection"].SetValue(m_CController.Projection/*m_ProjectionMatrix*/); m_Effect.Parameters["xWorld"].SetValue(WorldMatrix/*Matrix.Identity*/); RasterizerState RS = new RasterizerState(); RS.CullMode = CullMode.None; RS.FillMode = FillMode.WireFrame; m_Device.RasterizerState = RS; m_Device.Clear(Color.CornflowerBlue); foreach (EffectPass Pass in m_Effect.CurrentTechnique.Passes) { Pass.Apply(); m_Device.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, m_Vertices, 0, m_Vertices.Length, m_Indices, 0, m_Indices.Length / 3, VertexPositionNormalTexture.VertexDeclaration); } }  
      Please help!
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!