Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18526894 authored by Romain Guy's avatar Romain Guy
Browse files

Add RenderScript fragment shader test

Change-Id: I03328a610c8eae6bb6d63ecbc4104d55997664cc
parent 7d8fc3c9
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)

LOCAL_PACKAGE_NAME := ShadersTest

include $(BUILD_PACKAGE)
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
          http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.shaderstest">

    <uses-permission android:name="android.permission.INTERNET" />
    
    <application android:label="_ShadersTest">
        <activity android:name="ShadersTest"
                  android:label="_ShadersTest"
                  android:theme="@android:style/Theme.Black.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
+286 KiB
Loading image diff...
+13 −0
Original line number Diff line number Diff line
void main() {
    // Non-linear depth value
    float z = gl_FragCoord.z;
    // Near and far planes from the projection
    // In practice, these values can be used to tweak
    // the focus range
    float n = UNI_near;
    float f = UNI_far;
    // Linear depth value
    z = (2.0 * n) / (f + n - z * (f - n));

    gl_FragColor = vec4(z, z, z, 1.0);
}
+141 KiB

File added.

No diff preview for this file type.

Loading