gl_FragColor undefined using GLSL 300 - webgl

When switching to GLSL 300, met the following error
The answers that were provided in the linked post above makes sense. My question here is how do you go about having the user choose a color (from an HTML list) to change the objects color? I am looking for tips on how to pass the vec4(1.0,0.0,0.0,1.0) from my .js switch statement (just example) to the fragment-shader in the HTML to update the color. Any tips would be great.
I have resolved my issue of passing the color from my .js to the HTML shader section. I found this post which was useful:
How can I fix this attribute error in WebGL?
Thanks

Related

Problem rendering SVG in Chrome mobile and iOS Safari mobile

Video of the problem
The problem happens when there is a screen switch or browser minimization, and it only happens with the svg element. Has anyone encountered this? How to fix?
imagem here
I managed to correct
good through this post
Clipping path in SVG not working in Safari
and this post http://tutorials.jenkov.com/svg/clip-path.html
but I had to make some adaptations...
how did i fix this problem
1st first
had to change inline structure that comes before all sinline svgs
before:[enter image description here][1]
[1]: https://i.stack.imgur.com/W8Pbl.jpg
after:
enter image description here
so far I had already converted all patches into points
tools that helped me in this work:
1st crucial tool because it is possible to convert paths code into points codes for polygon
https://codepen.io/team/amcharts/full/zYORoNE software built on the code pen
2st another tool to remove parts of unnecessary text such as curly braces ({}) spaces and commas that because the conversion tool transforms results into arrray
http://www.unit-conversion.info/texttools/replace-text/
3st another tool to remove lines breaks
https://www.textfixer.com/tools/remove-line-breaks.php
4st another last tool but not less important because it is possible to test directly online before inserting it in the code definitively
https://www.w3schools.com/graphics/tryit.asp?filename=trysvg_polygon
that was a good tool
final result :
before
before applying any new structure
after: after applying any new structure
I want to thank all the devs who collaborated with me, either by creating the free software and the post made, my thanks to everyone, the people of the stackoverflow, thanks!

Reload data in Amchart

I'm using this library,
https://github.com/ChimpStudios/AmCharts
It works cool, but i didn't find how to reload existing chart. When i call multiple times:
self.mapView.chart = self.map
self.mapView.drawChart()
map disappear or it's color set to black. In original AmChart for JavaScript, object has method validateData, but this method i didn't find in IOS library.
If someone used this library, please help, because in github author not answer.
I'm unfamiliar with this specific library/wrapper, but looking in the repo, it does appear that both chart.validateData() and chart.validateNow() are supported.
Example usage in ChartView.m

Load image data for texture (texImage2DTyped?)

I found several ways to load an image and use it as a texture. All examples I found use texImage2D. But according to the docs this method is some what deprecated. Two alternatives stood out to me: texImage2DUntyped or texImage2DTyped. The untyped version can be fed with an ImageElement for the pixel data but I don't know what values I should pass in for the other parameters?
Because I'd like to abstract the html stuff from the actual gl rendering code I'd like a way, I can load the image and pass the data to the rendering code. I think texImage2DTyped would be good here, but I can't find an example how to load an image as TypedData. And again, what are the possible values for the other parameters?
TL:DR: Is there an example for texImage2DUntyped?
There is an open ticket for the documentation issue:
https://code.google.com/p/dart/issues/detail?id=16195
By the way, I'm using both texImage2DTyped and texImage2DImage here:
https://code.google.com/p/negentropia/source/browse/wwwroot/dart/texture.dart
texImage2DTyped --> takes data from a Uint8List
texImage2DImage --> takes data from a ImageElement

No geometry value provided at geodjango admin

I'm trying geodjango for my pet project and everything looks good with an exception...
In my model I have a field like this:
coordinates= models.PointField(srid=4326,default='POINT(0.0 0.0)')
and my admin extends from admin.OSMGeoAdmin but when I open a new model instance in the admin, I'm not seeing the '0.00,0.00' point selected in the map and if I try to save the document, I'll get 'No geometry value provided'. Like if the admin just Can't put the point in the map.
Also, if I try using the shell, I can save instances w/o problem and get the field with the default value POINT(0.0 0.0).
Am I missing something in the admin?
Thanks for any hint!
I have the same issue.
It's weird. What is getting POSTed makes no sense.
At the point of hitting submit the textarea has the correct geometry value (as I put an onsubmit on the form that outputs me this value).
But what gets submitted is not that value.
So I turned JS off... wow. The correct value is submitted and I am a little happier, but this is not a solution.
But what javascript is doing this I don't know.
I've tried this with Django 1.3 and 1.4.
Have you had any luck?
update. one more 'solution'... override openlayers.html and turn the textarea to a standard text input. wow. works again.
SOLVED!
So mine took some digging... but my admin uses tinymce... Tinymce works on textareas yeah.... well it screwed up the widgets textarea, but ever so silently.
editor_deselector : "vWKTField"
Well, after toying around with open layers.html (THANKS noisyboiler!) I found there is an attribute on the OSMGeoAdmin display_wkt, setting it to True will show the textArea without hacking the template.
For entries with existing points, it contains a value in this format:
SRID=3857;POINT(890338.8453418 -1109499.0330941)
So I just change my Point Field to:
coordinates= models.PointField(srid=4326,default='SRID=3857;POINT(0.0 0.0)')
What I understand from Spherical Mercator is that 4326 is for two-dimensional maps, but seems like google Maps uses 3857 which includes a spherical projection.
Now works!

Mathjax after Ajax call

So my problem is as follow:
So firstly, I made a ajax call to another page and replaces some of the elements in my current DOM with the new information, which utilize Mathjax to render their math formulas. However, after my ajax call, Mathjax doesn't seem to be loaded again thus not rendering the math formulas for my new math formulas. Does anyone have encountered this before? What is the solution?
Thanks a lot
This Mathjax documentation page should help you a lot.
For example, it has MathJax.Hub.Queue(["Typeset",MathJax.Hub]); method call to update every new node on the page.
In addition to Daniel O'Hara answer you also might try to call MathJax.Hub.Queue(["Reprocess",MathJax.Hub]). Or call MathJax.Hub.Typeset() directly but its not recommended to do so in production

Resources