tag:blogger.com,1999:blog-1265125331765205173.post7577036090966248799..comments2024-03-13T09:09:15.066+01:00Comments on Dreamstate Coding: OpenGL 4 with OpenTK in C# Part 2: Compiling shaders and linking themUnknownnoreply@blogger.comBlogger20125tag:blogger.com,1999:blog-1265125331765205173.post-30647869623340308682019-10-10T02:16:57.530+02:002019-10-10T02:16:57.530+02:00Hello,
I followed this to a T. However for some re...Hello,<br />I followed this to a T. However for some reason the <br /><br />private int CreateProgram() //is throwing an error. MainWindow.CreateProgram(): not all code paths <br /> return a value.Anonymoushttps://www.blogger.com/profile/08589488483435689662noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-34388586388336120852019-08-25T02:49:42.638+02:002019-08-25T02:49:42.638+02:00Hello, for some reason this line:
int vertexShader...Hello, for some reason this line:<br />int vertexShader = GL.CreateShader(ShaderType.VertexShader);<br /><br />...throws the exception: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'Anonymoushttps://www.blogger.com/profile/13867034411189399152noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-89482684519773880522019-06-02T16:21:00.977+02:002019-06-02T16:21:00.977+02:00Ok, after downloading the release i found out that...Ok, after downloading the release i found out that the both methods 'GL.BindVertexArray' and 'GL.GenVertexArrays' were placed in ES30 namespace:<br /><br />OpenTK.Graphics.ES30.GL.GenVertexArrays();<br />OpenTK.Graphics.ES30.GL.BindVertexArray();<br /><br />Hope this helps someone else :DXhevathttps://www.blogger.com/profile/13712785641734122159noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-5961162166929416512019-06-02T16:14:29.259+02:002019-06-02T16:14:29.259+02:00GL.BindVertexArray and GL.GenVertexArrays methods ...GL.BindVertexArray and GL.GenVertexArrays methods do not exist in OpenTK.<br />I am using OpenTK nuget version '3.0.1'.<br />I also tried downloading latest release of OpenTK from github:<br />https://github.com/opentk/opentk/releases/tag/v3.0.0<br />But the method is still not foundXhevathttps://www.blogger.com/profile/13712785641734122159noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-35302304638752048312019-03-20T20:11:08.687+01:002019-03-20T20:11:08.687+01:00I think the easiest is probably to create a new co...I think the easiest is probably to create a new code file and rename it and replace the content.<br />Just remember to set the properties of the file to 'copy if newer' in Visual Studio so that it gets copied to your output folder during the build.Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-57680922964682048282019-03-20T04:31:42.400+01:002019-03-20T04:31:42.400+01:00how to create
vertexShader.vert and fragmentShade...how to create <br />vertexShader.vert and fragmentShader.frag <br />files in VS2017 please.BigCathttps://www.blogger.com/profile/00944698171941005006noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-22820051234346106622019-03-20T03:57:18.688+01:002019-03-20T03:57:18.688+01:00for this tutorial you can use this code
...for this tutorial you can use this code<br /> GL.ShaderSource(vertexShader,<br /> "#version 440 core " +<br /> "void main(void){" +<br /> "gl_Position = vec4(0.25, -0.25, 0.5, 1.0);" +<br /> "}"<br /> );BigCathttps://www.blogger.com/profile/00944698171941005006noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-88416418167207328362018-12-04T15:04:07.459+01:002018-12-04T15:04:07.459+01:00Hi there, you need to save the vertex shader from ...Hi there, you need to save the vertex shader from the post into a text file that is placed in the folder specified by that line.<br />If you have trouble with that, try downloading the source from github in a later post of this tutorial!Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-74159683317685587562018-12-02T15:31:01.681+01:002018-12-02T15:31:01.681+01:00NOT WORK
GL.ShaderSource(vertexShader, File.Read...NOT WORK<br /><br /> GL.ShaderSource(vertexShader, File.ReadAllText(@"Components\Shaders\vertexShader.vert"));Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-59367559192626377732018-09-30T20:38:16.405+02:002018-09-30T20:38:16.405+02:00Hi there, the 0.5 is the Z axis, i.e. depth. for m...Hi there, the 0.5 is the Z axis, i.e. depth. for more details on Z axis look at https://learnopengl.com/Getting-started/Coordinate-Systems and scroll down to the Right-handed system part. <br />The 1.0 is W, the recommendation is to use W = 1 when starting out. For detailed information, check out https://www.tomdalling.com/blog/modern-opengl/explaining-homogenous-coordinates-and-projective-geometry/ Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-6556861428977873922018-09-30T11:24:11.903+02:002018-09-30T11:24:11.903+02:00I have a question.
In gl_Position = vec4(0.25, -0....I have a question.<br />In gl_Position = vec4(0.25, -0.25, 0.5, 1.0);,<br />What do "0.5" and "1.0" mean?<br /><br />I (probably) know that the first two things are x and y each.<br />But what about the others?<br /><br />I changed them to 0 each, then it didn't work!<br /><br />Sorry for my bad English, from S. Korea.하누https://www.blogger.com/profile/02980792121803333653noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-74256061953683312642018-03-28T12:54:01.111+02:002018-03-28T12:54:01.111+02:00This comment has been removed by the author.Çağrı Şenelhttps://www.blogger.com/profile/07045050611814919845noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-62269596699734939112018-03-12T14:23:51.614+01:002018-03-12T14:23:51.614+01:00Thank you for your kind words!Thank you for your kind words!Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-35536753112538336892018-01-10T19:31:32.453+01:002018-01-10T19:31:32.453+01:00Have you tried to download the solution from githu...Have you tried to download the solution from github? From part 5 and forward at https://github.com/eowind/dreamstatecoding<br />This tutorial series uses openGL 4 specific APIs so I dont think that 130 would work as it uses legacy APIs (openGL 3.0 to be specific)Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-59180886730742885902018-01-06T07:03:42.684+01:002018-01-06T07:03:42.684+01:00I can't seem to render the red dot. I don'...I can't seem to render the red dot. I don't think shader version #440 is playing nicely. I"m trying to do this with VS on Mac OSX. I've tried #130 but no luck. There are some other examples online that render triangles and setup a modelView and that works. But i'd like to tryhttps://dreamstatecoding.blogspot.com/logout?d=https://www.blogger.com/logout-redirect.g?blogID%3D1265125331765205173%26postID%3D7577036090966248799 to get your stuff working as well.411https://www.blogger.com/profile/01564709354837431927noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-1795693534435518372017-08-09T22:16:16.283+02:002017-08-09T22:16:16.283+02:00Very good tutorials! I love them (and your cats :D...Very good tutorials! I love them (and your cats :D)!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-50247085212793075202017-06-06T13:53:58.523+02:002017-06-06T13:53:58.523+02:00Sorry for the late reply. Thanks for the help, i m...Sorry for the late reply. Thanks for the help, i managed to get it working now!SonicPowerTeamhttps://www.blogger.com/profile/15414885426603349461noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-321714139441456742017-05-17T19:52:04.622+02:002017-05-17T19:52:04.622+02:00Hi there.
You are on the track for the answer. The...Hi there.<br />You are on the track for the answer. The VertexShader portion is to be saved in a text file called vertexShader.vert and the FragmentShader part it saved in a file called fragmentShader.frag.<br />If you do not get it working, please look in the github repository for part 4:<br />https://github.com/eowind/dreamstatecoding<br />Hope this helps!Eowindhttps://www.blogger.com/profile/07393994040841014328noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-80599253950320139172017-05-15T18:25:48.225+02:002017-05-15T18:25:48.225+02:00and where do i find vertexShader.vert and fragment...and where do i find vertexShader.vert and fragmentShader.vert as it keeps giving me an error that it isn't foundSonicPowerTeamhttps://www.blogger.com/profile/15414885426603349461noreply@blogger.comtag:blogger.com,1999:blog-1265125331765205173.post-40040760195330361032017-05-15T17:34:26.484+02:002017-05-15T17:34:26.484+02:00Where to i apply the code for the VertexShader and...Where to i apply the code for the VertexShader and FragmentShaderSonicPowerTeamhttps://www.blogger.com/profile/15414885426603349461noreply@blogger.com