Question

In: Computer Science

Describe how you would adapt the RGB color model in WebGL to allow you to work...

Describe how you would adapt the RGB color model in WebGL to allow you to work with a subtractive color model.

Solutions

Expert Solution

Basically colours with 0 to 1 range are processed in WebGL and storing the colours depends upon the user. Similar to CSS, where you mention the colour in format such as #123456, for red: rgb(18,52,86). However, the hindrance in WebGL commence when the user built textures as well as buffers. In-order to adapt the RGB colours in WebGL, the binary structure of the buffer should be determined and then apply the data in that particular buffer. The WebGL will transform binary into values and user can use it in WebGL. For instance, building a texture employing gl.UNSIGNED_BYTE in format of storage and the texture ranges from 0 to 255 and WebGL the values will get transformed into 0 to 1. The gl.float employ 0 to 1 but it needs 4x for storage. The vertex colour data can be stored as gl.UNISIGNED BYTE and when reading the data , the values will be back to 0 to 1. The drawing of the pixel depends on the user (programmer) for instance, if user mention [10, 20, 30, 40] , it does not mean that red is the first value, WebGL is often considered as rasterization engine which enables drawing of values into 2D arrays. Let us see how to apply colours :

  • Step1 : Employing the getContext(), WebGL should be furnished.   
  • Step 2: For instance if you want to draw triangles and colour in RGB, the geometry should be specified and stored in buffer objects with indices. And now apply RGB colours by creating a variable the colours are then applied to it.  

Related Solutions

Describe how you would observe the light coming from a light bulb. What is the color,...
Describe how you would observe the light coming from a light bulb. What is the color, directionality, intensity, etc.?
Detail how calcium ions work to allow for muscle contraction. Be sure to describe the roles...
Detail how calcium ions work to allow for muscle contraction. Be sure to describe the roles of sarcoplasmic reticulum, tropomyosin, troponin, ATP, actin and myosin.
How would you choose between the different types of architecture that would allow you to cover...
How would you choose between the different types of architecture that would allow you to cover for redundancy, common access, and service to remote offices?
You are a nurse working in a disadvantaged community (indigenous community). Describe how you would work...
You are a nurse working in a disadvantaged community (indigenous community). Describe how you would work in partnership using a strengths-based approach with community groups to develop a mutually respectful and supportive collaboration in a high needs community to address a health issue on obesity
Describe the difference between a culturally/linguistically different (CLD)model and the deficit model. How would you adjust...
Describe the difference between a culturally/linguistically different (CLD)model and the deficit model. How would you adjust your school nurse practice to reflect these differences?
How would the musculoskeletal system of humans adapt to a low gravity environment? What would their...
How would the musculoskeletal system of humans adapt to a low gravity environment? What would their bones and muscles look like? Consider the following parts of the musculoskeletal system in your answer: Bone length, Bone diameter, Bone density, Muscle type, location, and size, Anything else you think is important to the musculoskeletal system.
Describe the development methodology and processes of (Model View Controller ) and explain how you would...
Describe the development methodology and processes of (Model View Controller ) and explain how you would recommend it for a healthcare department?.
What is the Outcome Based Model of Fehr and Schmidt? How would you describe the Trust...
What is the Outcome Based Model of Fehr and Schmidt? How would you describe the Trust and Reciprocity hypothesis?
Suppose that you have been asked to analyze an economic model. Describe how you would structure...
Suppose that you have been asked to analyze an economic model. Describe how you would structure your analysis?
Briefly describe a health program planning model and how you have applied or would apply it...
Briefly describe a health program planning model and how you have applied or would apply it to the planning process. Include a specific population and topic.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT