{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/16244","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/16244/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/16244/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/16244/events","html_url":"https://github.com/godotengine/godot/issues/16244","id":293235542,"number":16244,"title":"Godot 3 Stable crashes when using modf in own shader","user":{"login":"Nophlock","id":8605748,"avatar_url":"https://avatars0.githubusercontent.com/u/8605748?v=4","gravatar_id":"","url":"https://api.github.com/users/Nophlock","html_url":"https://github.com/Nophlock","followers_url":"https://api.github.com/users/Nophlock/followers","following_url":"https://api.github.com/users/Nophlock/following{/other_user}","gists_url":"https://api.github.com/users/Nophlock/gists{/gist_id}","starred_url":"https://api.github.com/users/Nophlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nophlock/subscriptions","organizations_url":"https://api.github.com/users/Nophlock/orgs","repos_url":"https://api.github.com/users/Nophlock/repos","events_url":"https://api.github.com/users/Nophlock/events{/privacy}","received_events_url":"https://api.github.com/users/Nophlock/received_events","type":"User","site_admin":false},"labels":[{"id":73330064,"url":"https://api.github.com/repos/godotengine/godot/labels/bug","name":"bug","color":"ff2222","default":true},{"id":279098111,"url":"https://api.github.com/repos/godotengine/godot/labels/topic:rendering","name":"topic:rendering","color":"ffdd44","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/godotengine/godot/milestones/7","html_url":"https://github.com/godotengine/godot/milestone/7","labels_url":"https://api.github.com/repos/godotengine/godot/milestones/7/labels","id":2529217,"number":7,"title":"3.1","description":"","creator":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars0.githubusercontent.com/u/4701338?v=4","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"open_issues":696,"closed_issues":44,"state":"open","created_at":"2017-05-18T13:33:56Z","updated_at":"2018-02-01T16:26:14Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-01-31T16:59:35Z","updated_at":"2018-02-01T17:16:37Z","closed_at":null,"author_association":"NONE","body":"**Godot version:**\r\n(3.0-Stable)\r\n\r\n**OS/device including version:**\r\nWindows 10\r\nRadeon RX 570 with Radeon 18.1.1\r\n\r\n\r\n**Issue description:**\r\nToday I wanted to play around with the built in shaders and for that I wanted to use the modf command, but as soon as I typed in this line:\r\n\r\nif( mod(UV.x,0.1) == 0.0)\r\n{\r\n\tALBEDO = vec3(1.0,0.0,0.0);\t\r\n}\r\n\r\nIt crashed immediatly and when I saved the shader before it got applied to the object, I couldn't reopen the project/scene until I manually edit the shader in the corresponding shaderfile to something else.  \r\n\r\n**Steps to reproduce:**\r\nCreate a new mesh, image or any type of objects that accept materials or own shaders. After that create a new \"ShaderMaterial\" for this object and open the builtin shaderedior. Type in a shader that is using modf or copy the following shader to the editor and wait until Godot wants to apply it:\r\n\r\nshader_type spatial;\r\nuniform float grid_size = 1.0;\r\n\r\nvoid fragment()\r\n{\r\n\tif( modf(UV.x,0.1) == 0.0)\r\n\t{\r\n\t\tALBEDO = vec3(1.0,0.0,0.0);\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\tALBEDO = vec3(0.0);\t\t\r\n\t}\r\n}\r\n\r\n\r\nNote: Godot doesn't crash with the \"mod\"-Function, only with \"modf\"  and I suggest you not to save the shader, except you want to edit the shaderfile all the time to reopen the project/scene ^^\r\n\r\n**Minimal reproduction project:**\r\nPlease note that in this example project I used \"mod\" so Godot doesn't crash at the startup. Just replace \"mod\" with \"modf\" in the shader and you are \"good to go\".\r\n[ModfBug.zip](https://github.com/godotengine/godot/files/1682496/ModfBug.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/362337333","html_url":"https://github.com/godotengine/godot/issues/16244#issuecomment-362337333","issue_url":"https://api.github.com/repos/godotengine/godot/issues/16244","id":362337333,"user":{"login":"binbitten","id":685718,"avatar_url":"https://avatars2.githubusercontent.com/u/685718?v=4","gravatar_id":"","url":"https://api.github.com/users/binbitten","html_url":"https://github.com/binbitten","followers_url":"https://api.github.com/users/binbitten/followers","following_url":"https://api.github.com/users/binbitten/following{/other_user}","gists_url":"https://api.github.com/users/binbitten/gists{/gist_id}","starred_url":"https://api.github.com/users/binbitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binbitten/subscriptions","organizations_url":"https://api.github.com/users/binbitten/orgs","repos_url":"https://api.github.com/users/binbitten/repos","events_url":"https://api.github.com/users/binbitten/events{/privacy}","received_events_url":"https://api.github.com/users/binbitten/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T17:16:37Z","updated_at":"2018-02-01T17:16:37Z","author_association":"CONTRIBUTOR","body":"Second argument of _modf()_ is actually an output parameter. Seems godot does not prevent using constants as outputs, which will cause glsl-error or crash depending on the driver. "}}
{"actor":{"display_login":"binbitten"}}