{"action":"created","issue":{"url":"https://api.github.com/repos/cedricpinson/osgjs/issues/649","repository_url":"https://api.github.com/repos/cedricpinson/osgjs","labels_url":"https://api.github.com/repos/cedricpinson/osgjs/issues/649/labels{/name}","comments_url":"https://api.github.com/repos/cedricpinson/osgjs/issues/649/comments","events_url":"https://api.github.com/repos/cedricpinson/osgjs/issues/649/events","html_url":"https://github.com/cedricpinson/osgjs/issues/649","id":171673336,"number":649,"title":"shader-generator and temporal examples are broken","user":{"login":"schmok","id":9993145,"avatar_url":"https://avatars.githubusercontent.com/u/9993145?v=3","gravatar_id":"","url":"https://api.github.com/users/schmok","html_url":"https://github.com/schmok","followers_url":"https://api.github.com/users/schmok/followers","following_url":"https://api.github.com/users/schmok/following{/other_user}","gists_url":"https://api.github.com/users/schmok/gists{/gist_id}","starred_url":"https://api.github.com/users/schmok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmok/subscriptions","organizations_url":"https://api.github.com/users/schmok/orgs","repos_url":"https://api.github.com/users/schmok/repos","events_url":"https://api.github.com/users/schmok/events{/privacy}","received_events_url":"https://api.github.com/users/schmok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-17T14:31:58Z","updated_at":"2016-08-23T12:35:19Z","closed_at":null,"body":"@cedricpinson\r\nI'm playing with osgjs for quite a bit now. \r\nSeems like the examples mentioned in the subject are broken.\r\n\r\nIn the console it says \r\n`Uncaught TypeError: Cannot read property 'slice' of undefined`\r\n\r\nLooks like there is no\r\n`osgShader.Compiler.validAttributeType` anymore\r\nThere were big changes to the Compiler, am I right?\r\n\r\n#### Edit:\r\nI found the solution\r\nthis declaration seems to be outdated ([/examples/shader-generator/negatif.js](https://github.com/cedricpinson/osgjs/blob/master/examples/shader-generator/negatif.js))\r\n`...\r\nvar NegatifAttribute = window.NegatifAttribute = function () {\r\n        osg.StateAttribute.call( this );\r\n        this._attributeEnable = false;\r\n    };\r\n    osg.createPrototypeStateAttribute( NegatifAttribute, osg.objectInherit( osg.StateAttribute.prototype, {\r\n       // code\r\n    } ), 'osg', 'Negatif' );\r\n...`\r\n\r\nReplace by using this here: ([/examples/shader-generator/CustomCompiler.js](https://github.com/cedricpinson/osgjs/blob/master/examples/shader-generator/CustomCompiler.js))\r\n`...\r\nNegatifAttribute.prototype = osg.objectLibraryClass( osg.objectInherit( osg.StateAttribute.prototype, {   \r\n // code\r\n    } ), 'osg', 'Negatif' );\r\n...`\r\n\r\nAnd also in CustomCompiler remove those lines:\r\n`\r\nCustomCompiler.validAttributeType = osgShader.Compiler.validAttributeType.slice();\r\n    CustomCompiler.validAttributeType.push( 'Negatif', 'Ramp' );\r\n`\r\n\r\nAnd add the validAttributeType to the ShaderGenerator instance: ([/examples/shader-generator/main.js](https://github.com/cedricpinson/osgjs/blob/master/examples/shader-generator/main.js))\r\n`\r\nvar shaderGenerator = new osgShader.ShaderGenerator();\r\nshaderGenerator.setShaderCompiler( CustomCompiler );\r\nshaderGenerator._acceptAttributeTypes.add('Ramp');\r\nshaderGenerator._acceptAttributeTypes.add('Negatif');\r\n`\r\n\r\nTook me quite a bit to figure this out..."},"comment":{"url":"https://api.github.com/repos/cedricpinson/osgjs/issues/comments/241716225","html_url":"https://github.com/cedricpinson/osgjs/issues/649#issuecomment-241716225","issue_url":"https://api.github.com/repos/cedricpinson/osgjs/issues/649","id":241716225,"user":{"login":"cedricpinson","id":351686,"avatar_url":"https://avatars.githubusercontent.com/u/351686?v=3","gravatar_id":"","url":"https://api.github.com/users/cedricpinson","html_url":"https://github.com/cedricpinson","followers_url":"https://api.github.com/users/cedricpinson/followers","following_url":"https://api.github.com/users/cedricpinson/following{/other_user}","gists_url":"https://api.github.com/users/cedricpinson/gists{/gist_id}","starred_url":"https://api.github.com/users/cedricpinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedricpinson/subscriptions","organizations_url":"https://api.github.com/users/cedricpinson/orgs","repos_url":"https://api.github.com/users/cedricpinson/repos","events_url":"https://api.github.com/users/cedricpinson/events{/privacy}","received_events_url":"https://api.github.com/users/cedricpinson/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T12:35:19Z","updated_at":"2016-08-23T12:35:19Z","body":"Ho sorry could you open a pull request with your changes ?\r\n"}}
{"actor":{"display_login":"cedricpinson"}}