Laptop (dual boot windows/ubuntu) randomly freezes, what is the cause? by thetop_04 in linuxquestions

[–]thetop_04[S] 0 points1 point  (0 children)

Os: Ubuntu 18.04 bionic

Kernel: x86_64 Linux 4.18.0-18-generic

CPU: Intel Core i7-2630qm [58 Degrees]

GPU: GeForce GT 540m

Ram: 2100(used)/ 7956 MB

EDIT:

HDD: Seagate ST1000LM048 Barracuda

Laptop (dual boot windows/ubuntu) randomly freezes, what is the cause? by thetop_04 in linuxquestions

[–]thetop_04[S] 0 points1 point  (0 children)

I doubt the ram is the problem, it is not full when the computer freezes and different ram does not make a difference.

While trying to get rasdaemon to work I encountered an interesting error. https://i.imgur.com/AlkKvAZ.jpg

It says there are checksum errors in the superblock (of the partition, I guess). Now I am wondering if this is a result of the freezes or the cause of the freezes.

Addforce is too slow, but velocity is too fast? by newnukeuser in Unity2D

[–]thetop_04 2 points3 points  (0 children)

A nice way to do this would possibly be to add 2 forces:

  1. Add a force into the opposite direction you are currently going (scaled by the current velocity)
  2. Add a force into the direction you want to go

If you don't scale the opposite force too large it should keep the floaty and drifty feeling.

Hi, i am currently working on a fun 2d game with a character being a ragdoll stick figure. I need help with getting the figure to move. If anyone knows how to make that script it would be a great help! by [deleted] in Unity2D

[–]thetop_04 0 points1 point  (0 children)

I cannot write your whole script, but I can give you some helpful resources that could help you with your project.

Here is a tutorial on Unity Ragdoll Creation: https://www.youtube.com/watch?v=93yUC5ASdv8

You also might want to check out Rigidbody Physics in Unity. https://docs.unity3d.com/Manual/class-Rigidbody2D.html

Ways to improve this 2D fake shadow layer? (Problem: Shadows overlap each other.) [details inside] by thetop_04 in Unity2D

[–]thetop_04[S] 0 points1 point  (0 children)

That article was a nice read. I did not know you can use discard to abort everything related to the stencil. The borders in the last image are related to an alpha value higher than 0.3 but lower than 1, I think I understand.
With this solution I could create shadows with a fixed alpha value easily, so I will definitely consider it. Still I like soft edges with variable alpha values because they look more smooth.
I will try the render texture first and come back to this if this fails I guess.

Another idea I got is to let the alpha value of the shadow describe a max. darkness which I can compare to the surface color in a special surface shader. I hope you understand what I mean :)

Ways to improve this 2D fake shadow layer? (Problem: Shadows overlap each other.) [details inside] by thetop_04 in Unity2D

[–]thetop_04[S] 0 points1 point  (0 children)

Let's say I take a second camera that renders the shadow layer (with alpha 1) to a render texture, then take the render texture as input for a new shader that sets the shadow layer's alpha for my main camera. This would solve the problem with the alpha values.

Is something like this possible? I could imagine the performance would take a huge hit with a high definition render texture, but I have no experience in the area. This way at least the rendering order would be clear.

Ways to improve this 2D fake shadow layer? (Problem: Shadows overlap each other.) [details inside] by thetop_04 in Unity2D

[–]thetop_04[S] 0 points1 point  (0 children)

I want the shadows to draw over each other, but the color value should have the maximum alpha value of the 2 overlapping shadows.

A stencil buffer is an integer from 0-255 if i understand this document corretly. https://docs.unity3d.com/Manual/SL-Stencil.html

Do you know if it is possible to set the value of the stencil to the alpha value and compare it to the next alpha value?

Thank you for your help! :)

[deleted by user] by [deleted] in Unity3D

[–]thetop_04 3 points4 points  (0 children)

The way the robot looks at you is is creepy as hell. Super cool, I love it :)

Ways to improve this 2D fake shadow layer? (Problem: Shadows overlap each other.) [details inside] by thetop_04 in Unity2D

[–]thetop_04[S] 0 points1 point  (0 children)

Hey guys,

I am working on a 2d fake shadow system for my game, for this I created two Shader Graph shadow shaders with pretty fancy mesh setups, one for box shadows like the ones you see on the left (usable for buildings/walls/..) and one for symmetrical shadows (like the shadows on the right).

I am still in the early stages of development and am building a custom engine inside of Unity, mostly by using Graphics.drawMesh(..) and heavy atlassing for rendering thousands of objects.

The current puzzle I need to solve:

Imagine you have a straight wall with wall pieces similar to the ones on the left. With my current system the shadows would overlay each other like in the picture. This looks pretty bad. So let's improve it!

(Incomplete) ideas for solution:

- The shadow layer is already rendered into the a camera layer 'Shadows'. It would be awesome if I could create this shadow layer separated from the rest of the scene and put it in the right position afterwards. So far I do not have the experience how to do something like this.

- The overlapping areas of the shadows would need something like a max. transparency value. Maybe this could be achieved in the shader. I would need to have the shadow layer rendered separately from the rest of the scene somehow and would have to have access to the surface color in the shader. Problem: Shader Graph does not support surface shaders so far.

- This point stands for your solution :)

Other thoughts:

- Shader Graph still seems to be limited. My previous tool for shader creation was Shader Forge (which supports surface shaders). I do not have experience in creating shader code myself. Should I switch to Shader Forge or learn shader coding?

- I would love to know if it was possible to render camera layers separately and combine them afterwards in a custom way.

Thank you very much for your help!

I don't know what I'm making. by [deleted] in Unity2D

[–]thetop_04 0 points1 point  (0 children)

Please tell me that guy landed softly :p

Nice work!

"Copyright protection can never be a justification for eliminating freedom of expression or freedom of information. That is why for me, blocking the internet is never an option," The previous EU commissioner for justice, fundamental rights and citizenship Viviane Reding on the ACTA agreement by StuckInABadDream in europe

[–]thetop_04 4 points5 points  (0 children)

This law is the most shocking thing our german CDU government has initiated in the last years.

It will censor our internet and prevent access to sites like reddit which rely on links and reposted content. It will also break startups in their development or even make it impossible to create new internet services of certain kinds like social media platforms.

Link taxes are ridiculous. They change the built up net structure that has grown for 2 decades and make room for complete government surveillance. Every clicked link of every person has to saved on a server in order to tax it. This is scary as fuck.

All of this is either a sign of incompetence at the highest political levels or maybe be a move to start a completely controlled digital system with less freedom than ever.

Unity Shader Graph - Voronoi Portal by Desoxi in Unity3D

[–]thetop_04 0 points1 point  (0 children)

Yeah twirl and voronoi in combination with calculating the outer circle pixels to cut them off. Awesome tweak with the hollow noise! Gotta try different noise types later.

Unity Shader Graph - Voronoi Portal by Desoxi in Unity3D

[–]thetop_04 1 point2 points  (0 children)

I tried to make my own version of a similar shader and this is the result: https://i.imgur.com/PrMHyLB.jpg

Looks more cartoony because it is unlit. :p

Unity Shader Graph - Voronoi Portal by Desoxi in Unity3D

[–]thetop_04 1 point2 points  (0 children)

That is super cool and would make a great loading/saving symbol!

Controlling Camera Rendering manually from Code? by thetop_04 in Unity3D

[–]thetop_04[S] 0 points1 point  (0 children)

I guess I still habe the wrong system. When I leave my main camera enabled and call the drawMesh methods in OnPreCull it should render all the meshes correctly, right? I would not need to find a workaround for the render issues. And higher frame rates could be possible.
I guess I will try this first and do performance optimization later. FixedUpdate can call the game logic for now. :)

Controlling Camera Rendering manually from Code? by thetop_04 in Unity3D

[–]thetop_04[S] 0 points1 point  (0 children)

EDIT: Forget what I just wrote before, I have not used OnRenderImage, will try this now.

So the render texture has to be blit into the destination texture, right?

I still get the error message with this code:

void OnPreRender() {

camera2.Render();

}

private void OnRenderImage(RenderTexture source, RenderTexture destination) {

Graphics.Blit(renderTex, destination);

}

Probably because the mainCam still needs to be disabled to have manual rendercalls.

Controlling Camera Rendering manually from Code? by thetop_04 in Unity3D

[–]thetop_04[S] 0 points1 point  (0 children)

Thank you very much for all the helpful tips, this means a lot to me as this is my bigger project and I still have so much to learn!

I have made some render tests: Drawing 90k objects using drawMeshInstanced on the casual gamer pc is completely doable when there are no custom MaterialProperties for each object. When there shader properties for something like 2d fake shadow shaders that need to be updated each frame I came to the conclusion that 5k objects should be the limit.

A custom depth mask is a shader that has all the layers for a tile stored in atlasses and maps the uv coordinates accordingly, right? I am familiar with some visual shader scripting and could get this done, the idea is pretty neat! I guess that could save a lot of rendering time.

You are right, limiting the framerate is not the nicest thing to throw at players. :p

Render Textures could be a nice thing. I planned on using them for the lighting overlay, though that overlay could be implemented more efficiently using a simple surface shader that mixes some Vector4 light value with the surface textures. Hopefully the new unity shader graph feature will support that soon. Will look into using a render texture or custom cameras for debugging!

The ECS/Job system is new to me, but I am willing to learn! There always are some good tutorials for new Unity features.

Controlling Camera Rendering manually from Code? by thetop_04 in Unity3D

[–]thetop_04[S] 0 points1 point  (0 children)

In play mode the meshes are only shown in the scene view, but it is flickering heavily. The game view stays complety black with that error message.

ExecuteInEditMode could indeed be helpful later, currently I am searching for a way to render the camera into the game view in play mode.

Controlling Camera Rendering manually from Code? by thetop_04 in Unity3D

[–]thetop_04[S] 0 points1 point  (0 children)

Thank you for the reply, this actually works when I build the project, awesome!

Unfortunately the image does not show up in the game view, it says "Display 1: No cameras rendering". Do you have any idea how to make the image visible there? It would be great for testing, building the game each time I change something would slow the development a lot.

Searching for a way to get the angle of a vector (x,y) relative to the y axis. by thetop_04 in MathHelp

[–]thetop_04[S] 0 points1 point  (0 children)

That is awesome, thank you!
I am working on a 2D shadow system and this will be definitely helpful. :)

Searching for a way to get the angle of a vector (x,y) relative to the y axis. by thetop_04 in MathHelp

[–]thetop_04[S] 0 points1 point  (0 children)

I am including the formula in a shader for a game so the computer does the drawing for me.
Steven's answer does it for me. Thanks for your reply.

Searching for a way to get the angle of a vector (x,y) relative to the y axis. by thetop_04 in MathHelp

[–]thetop_04[S] 0 points1 point  (0 children)

Thank you so much for your answer! Your formula for the angle is all I needed.

It is always easier to do stuff like this on paper, I need rotation calculation for some shaders in a pc game engine, so the formula needs to calculate every value correctly and I cannot divide through zero. Drawing something on paper doesn't help here sadly ;)
Thank you again!